cli-calls

1.0.0 • Public • Published

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!

Readme

Keywords

Package Sidebar

Install

npm i cli-calls

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

2.46 kB

Total Files

4

Last publish

Collaborators

  • foysavas