UNPKG

magicli

Version:

Automagically generates command-line interfaces (CLI) for any module. Expected options and help sections are created automatically based on parameters names, with support to async. It can be installed globally, in order to *execute* any module, or .js fil

38 lines (36 loc) 584 B
#!/usr/bin/env node 'use strict'; require('../../../../')({ commands: { 'a-b-c-d-e-f': { options: [{ name: 'f1', required: true }], pipe: { after: JSON.stringify } }, 'general-test-module-async': { pipe: { stdin: (stdinValue, args) => { args.param2 = stdinValue; return args; }, after: JSON.stringify } } }, validateRequiredParameters: true, enumerability: 'all', help: { option: 'modulehelp', stripAnsi: true }, version: { option: 'moduleversion' }, pipe: { after: result => `${result}\n=========` } });