cli-app-startup

0.0.2 • Public • Published

node-cli-app-startup

Gathers app configuration from CLI or ENV vars and passes them to function

Example

import startCliApp from "cli-app-startup";
import path, {dirname} from "path";
import {fileURLToPath} from "url";

const __dirname = dirname(fileURLToPath(import.meta.url));

startCliApp(
    (config) => {
        console.log("Started with config", config);
    },
    {
        cliOptions: [
            {name: "my-var", alias: "m", defaultOption: true, envvar: "my_var", default: "defaultvalue", description: "A custom CLI option or ENV var", type: String}
        ],
        packageInfo: path.join(__dirname, 'package.json')
    }
);

Readme

Keywords

none

Package Sidebar

Install

npm i cli-app-startup

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

5.3 kB

Total Files

4

Last publish

Collaborators

  • johnvmt