# node-sanitize-options

> Combines any options passed by user with default options so that they are never undefined.

Latest version **0.0.6** (published 2019-02-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-sanitize-options
pnpm add node-sanitize-options
yarn add node-sanitize-options
bun add node-sanitize-options
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2019-02-11 |
| First published | 2019-01-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 8.x |
| Dependencies | 0 |
| Unpacked size | 2.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | rehmat |
| Keywords | node, sanitize, options, default, config |

## Links

- npm: https://www.npmjs.com/package/node-sanitize-options
- Repository: https://github.com/animatedcreativity/node-sanitize-options
- Homepage: https://github.com/animatedcreativity/node-sanitize-options#readme
- Issues: https://github.com/animatedcreativity/node-sanitize-options/issues
- npm.io page: https://npm.io/package/node-sanitize-options

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.0.6 (latest) — 2019-02-11
- 0.0.5 — 2019-02-11
- 0.0.4 — 2019-01-21
- 0.0.3 — 2019-01-20
- 0.0.2 — 2019-01-20
- 0.0.1 — 2019-01-20

## README

# node-sanitize-options
Combines any options passed by user with default options so that they are never `undefined`.

Example:

```
var saveProduct = function(options) {
  var sanitize = require("node-sanitize-options");
  options = sanitize.options(options, {model: "ABC-001", price: 23.4, taxRate: 25, status: true});
  console.log(options);
};
saveProduct({model: "XYZ-002", price: 70.24});
```

will output:

```
{
  "model": "XYZ-002",
  "price": 70.24,
  "taxRate": 25,
  "status": true
}
```

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