# miniopt

> A minimal option parser.

Latest version **1.0.0** (published 2016-09-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install miniopt
pnpm add miniopt
yarn add miniopt
bun add miniopt
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-09-25 |
| First published | 2016-09-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | EGOIST |
| Maintainers | rem |
| Keywords | miniopt, parse, option, arguments |

## Links

- npm: https://www.npmjs.com/package/miniopt
- Repository: https://github.com/egoist/miniopt
- Homepage: https://github.com/egoist/miniopt#readme
- Issues: https://github.com/egoist/miniopt/issues
- npm.io page: https://npm.io/package/miniopt

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-09-25

## README

# miniopt

[![NPM version](https://img.shields.io/npm/v/miniopt.svg?style=flat-square)](https://npmjs.com/package/miniopt) [![NPM downloads](https://img.shields.io/npm/dm/miniopt.svg?style=flat-square)](https://npmjs.com/package/miniopt) [![Build Status](https://img.shields.io/circleci/project/egoist/miniopt/master.svg?style=flat-square)](https://circleci.com/gh/egoist/miniopt)

<details><summary>Table of Contents</summary>

<!-- toc -->

- [Install](#install)
- [Usage](#usage)
- [API](#api)
  * [miniopt(input)](#minioptinput)
    + [input](#input)
- [Contributing](#contributing)
- [License](#license)

<!-- tocstop -->

</details>

## Install

```bash
$ npm install --save miniopt
```

## Usage

```js
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](https://egoist.mit-license.org/) © [EGOIST](https://github.com/egoist)

---
_Source: https://npm.io/package/miniopt · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
