1.0.0 • Published 8 years ago

miniopt v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

miniopt

NPM version NPM downloads Build Status

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

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

MIT © EGOIST