Skip to content

romeovs/optimal.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Optimal.js

A simple options parser for node that can get options from different sources.

Installation

npm install optimal.js --save

Example

import optimal from 'optimal'

const opts = optimal('prefix', { config: 'config-file' })

const v = opts.option('foo')
  .type('integer')
  .description('foo is an integer')
  .required()
  .get()

If run, this script would try to get the foo option from these locations:

  • the --foo parameter
  • a key named foo in the config file pointed to by the config-file option
  • the PREFIX_FOO envirnment variable

The value will be parsed and ready to use!

Docs

To do!

About

a simple options parser for node that gets options from multiple sources

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published