1.0.0 • Published 8 years ago
miniopt v1.0.0
miniopt
Install
$ npm install --save miniopt
Usage
const miniopt = require('miniopt')
miniopt('[foo=123 bar="hello world" baz]')
// {
// foo: 123,
// bar: 'hello world',
// baz: true
// }
// namespaced
miniopt('[namespace foo="bar"]')
// {
// namespace: {
// foo: 'bar'
// }
// }
// multi-line support
miniopt(`
[namespace
foo="bar"
bar=123
]
`)
API
miniopt(input)
input
Type: string
A valid string like [foo bar=123 baz=false zoo="as"]
Returns parsed object or null
if it's an invalid string.
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
License
1.0.0
8 years ago