diff --git a/docs/modules/commander.md b/docs/modules/commander.md new file mode 100644 index 0000000..9fe8080 --- /dev/null +++ b/docs/modules/commander.md @@ -0,0 +1,33 @@ +--- +description: Modern alternatives to packages for building CLI applications +--- + +# Replacements for CLI builders + +## `sade` + +[`sade`](https://github.com/lukeed/sade) is a small but powerful tool for building CLI applications for Node.js + +```ts +import sade from 'sade' + +const prog = sade('my-cli') + +prog + .version('1.0.5') + .option('--global, -g', 'An example global flag') + .option('-c, --config', 'Provide path to custom config', 'foo.config.js') + +prog + .command('build ') + .describe('Build the source directory. Expects an `index.js` entry file.') + .option('-o, --output', 'Change the name of the output file', 'bundle.js') + .example('build src build --global --config my-conf.js') + .example('build app public -o main.js') + .action((src, dest, opts) => { + console.log(`> building from ${src} to ${dest}`) + console.log('> these are extra opts', opts) + }) + +prog.parse(process.argv) +``` diff --git a/manifests/preferred.json b/manifests/preferred.json index 8d5c15e..9114e7f 100644 --- a/manifests/preferred.json +++ b/manifests/preferred.json @@ -126,6 +126,12 @@ "replacements": ["util.styleText", "picocolors", "ansis"], "url": {"type": "e18e", "id": "chalk"} }, + "commander": { + "type": "module", + "moduleName": "commander", + "replacements": ["sade"], + "url": {"type": "e18e", "id": "commander"} + }, "copy-text-to-clipboard": { "type": "module", "moduleName": "copy-text-to-clipboard", @@ -3371,6 +3377,12 @@ "type": "documented", "replacementModule": "rollup-plugin-visualizer" }, + "sade": { + "id": "sade", + "type": "documented", + "url": {"type": "e18e", "id": "commander"}, + "replacementModule": "sade" + }, "smol-toml": { "id": "smol-toml", "type": "documented",