# is-options

> Easily check if input is an options map

Latest version **1.0.2** (published 2021-11-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-options
pnpm add is-options
yarn add is-options
bun add is-options
```

## 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.2 |
| Published | 2021-11-22 |
| First published | 2018-03-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Mathias Buus |
| Maintainers | mafintosh |

## Links

- npm: https://www.npmjs.com/package/is-options
- Repository: https://github.com/mafintosh/is-options
- Issues: https://github.com/mafintosh/is-options/issues
- npm.io page: https://npm.io/package/is-options

## Dependencies (1)

- [b4a](https://npm.io/package/b4a.md) ^1.1.1

## Recent versions

- 1.0.2 (latest) — 2021-11-22
- 1.0.1 — 2018-03-17
- 1.0.0 — 2018-03-17

## README

# is-options

Easily check if input is an options map

```
npm install is-options
```

[![Build Status](https://travis-ci.org/mafintosh/is-options.svg?branch=master)](https://travis-ci.org/mafintosh/is-options)

## Usage

``` js
var isOptions = require('is-options')

thing('', {foo: true}) // key='', opts={foo: true}
thing({foo: true}) // key=undefined, opts={foo: true}
thing(Buffer.from('buf'), {foo: true}) // key=Buffer('buf'), opts={foo: true}

function thing (optionalKey, opts) {
  if (isOptions(optionalKey)) {
    opts = optionalKey
    optionalKey = undefined
  }

  console.log('key', optionalKey)
  console.log('options', opts)
}
```

## API

#### `bool = isOptions(obj)`

Returns true is `obj` is an object and not a buffer

## License

MIT

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