@complyify/cli

0.1.1 • Public • Published

@complyify/cli

Installation

npm install @complyify/cli

Parameters

Parameter values can be provided via:

  1. configuration file, or
  2. environment variable, or
  3. command line argument

Should a parameter be provided in multiple places, the effective value will be that of the last place to specify, which is evaluated in the aforementioned order.

i.e., command line argument before environment variable before configuration file

Usage

#!/usr/bin/env node

import CLI from '@complyify/cli';
import Promise from 'bluebird';

async function report() {
  console.log(`report from "${this.name}"`);
  // TODO implement whatever report stuff you want to do here
}

async function debug() {
  console.log('debug on');
  // TODO enable your debugging here
}

CLI.create('my-app')
  .param({ arg: 's', cfg: 'some.where.out.there', env: 'OVER_THE_RAINBOW', desc: 'way up high' })
  .flag({ arg: 'd', desc: 'debug', handler: debug })
  .default({ desc: 'generate report', handler: report })
  .exec().catch(err => console.error(err));

Readme

Keywords

none

Package Sidebar

Install

npm i @complyify/cli

Weekly Downloads

3

Version

0.1.1

License

MIT

Last publish

Collaborators

  • sbruton
  • fuqua
  • ggquinones