clivage

1.0.0 • Public • Published

clivage

Build Status Coverage Status Dependency Status

Command-line helper.

Install

With npm:

$ npm install --save clivage joi

With yarn:

$ yarn add clivage joi

Note that joi is a peer dependency.

Now with update-notifier

The module now uses update-notifier to let the user know about updates to this program.

Users have the ability to opt-out of the update notifier by changing the optOut property to true in ~/.config/configstore/update-notifier-[YOUR-MODULE-NAME].json. The path is available in notifier.config.path.

Users can also opt-out by setting the environment variable NO_UPDATE_NOTIFIER with any value or by using the --no-update-notifier flag on a per run basis.

Usage

const clivage = require('clivage')


const schema = joi.object({
  port: joi.number().integer(),
  host: joi.string().optional(),
  user: joi.string().optional(),
  pw: joi.string().optional()
})
  .with('pw', 'user')
  .with('user', 'pw')

const cli = clivage(schema)
cli.flags

//=> { port: 1234, host: 'http://localhost:5984' }

API

clivage(options)

options

schema

Type: object (joi)

Lorem ipsum.

alias

Type: array

argv

Type: object

Lorem ipsum.

help

Type: string

Lorem ipsum.

prefix

Type: string

Lorem ipsum.

envPath

Type: string

Lorem ipsum.

License

AGPL-v3 © 2017 Robin Millette

Readme

Keywords

Package Sidebar

Install

npm i clivage

Weekly Downloads

1

Version

1.0.0

License

AGPL-3.0

Last publish

Collaborators

  • millette