# o-shiny

> Removes inherited properties, nulls, functions as well as empty strings, arrays and objects from JavaScript objects.

Latest version **0.1.6** (published 2014-12-19) · 0 weekly downloads

## Install

```sh
npm install o-shiny
pnpm add o-shiny
yarn add o-shiny
bun add o-shiny
```

Provides the command `shine`.

## 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.1.6 |
| Published | 2014-12-19 |
| First published | 2014-12-19 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.x |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | FluidApps |
| Maintainers | fluidapps |
| Keywords | object, clean, json, empty, strip, remove |

## Links

- npm: https://www.npmjs.com/package/o-shiny
- Repository: https://github.com/FluidApps/o-shiny
- Issues: https://github.com/FluidApps/o-shiny/issues
- npm.io page: https://npm.io/package/o-shiny

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) >=2.0.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.1.6 (latest) — 2014-12-19
- 0.1.5 — 2014-12-19
- 0.1.4 — 2014-12-19
- 0.1.3 — 2014-12-19
- 0.1.2 — 2014-12-19
- 0.1.1 — 2014-12-19
- 0.1.0 — 2014-12-19

## README

o-shiny
=======

[![Build Status](https://travis-ci.org/FluidApps/o-shiny.svg?branch=master)](https://travis-ci.org/FluidApps/o-shiny)

Removes inherited properties, nulls, functions as well as empty strings, arrays
and objects from JavaScript objects.

Installation
------------
```
npm install o-shiny
```

Usage
-----

**Using an object as input**

```
var shine = require('o-shiny');

var object = {
    keyA: '',
    keyB: {},
    keyC: []
    keyD: null,
    keyE: function() {},
    keyF: 'o-shiny'
};

var shinyObject = shine(object);
```

*Result*
```
{
    keyF: 'o-shiny'
}
```

**Using a JSON string as input**

```
var json = '{"key": "o-shiny"}';

var shinyObject = shine(json);
```

*Result*

```
{
    key: 'o-shiny'
}
```

Options
-------

By default, shine will remove inherited properties, nulls, functions as well as
empty strings, arrays and objects. They may all be individually overriden.

**Defaults**

```
var allow = {
    hasOwnProperty: true,
    nulls: false,
    functions: false,
    emptyStrings: false,
    emptyArrays: false,
    emptyObjects: false,
    blacklist: [],
    whitelist: []
};
```

> `blacklist`: an array of keys to remove even if their content is otherwise valid

> `whitelist`: an array of keys to leave in the resulting object, except if their content is invalid

Tests
-----

```
mocha
```

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