Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/romeovs/optimal.js
a simple options parser for node that gets options from multiple sources
https://github.com/romeovs/optimal.js
Last synced: 24 days ago
JSON representation
a simple options parser for node that gets options from multiple sources
- Host: GitHub
- URL: https://github.com/romeovs/optimal.js
- Owner: romeovs
- Created: 2016-06-24T12:32:01.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-06-24T12:34:42.000Z (over 8 years ago)
- Last Synced: 2024-10-13T05:28:39.123Z (about 1 month ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Optimal.js
A simple options parser for node that can get options from different sources.
## Installation
```
npm install optimal.js --save
```## Example
```js
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 variableThe value will be parsed and ready to use!
## Docs
To do!