cli-calls
v1.0.0
Published
Quickly turn a JavaScript file into a CLI
Downloads
4
Readme
cli-calls
npm i cli-calls
Quickly turn a JavaScript file into a CLI.
Step 1: add a function that takes in single object of args, for example:
function main({name}) {
console.log(`hello ${name}!`);
}
Step 2: add cli-calls to your file:
import cliCalls from 'cli-calls';
await cliCalls(import.meta, main);
Step 3: run the file from you cli
node ./main.mjs --name world
hello world!