# flatify-obj

> Flatten nested javascript objects into a single-depth object.

Latest version **2.0.0** (published 2020-10-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install flatify-obj
pnpm add flatify-obj
yarn add flatify-obj
bun add flatify-obj
```

## 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 | 2.0.0 |
| Published | 2020-10-07 |
| First published | 2020-10-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12 |
| Dependencies | 1 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Rocktim Saikia |
| Maintainers | rocktimsaikia |
| Keywords | Flatten, flat, object, objects, flatten-object, flat-object |

## Links

- npm: https://www.npmjs.com/package/flatify-obj
- Repository: https://github.com/RocktimSaikia/flatify-obj
- Homepage: https://github.com/RocktimSaikia/flatify-obj#readme
- Issues: https://github.com/RocktimSaikia/flatify-obj/issues
- npm.io page: https://npm.io/package/flatify-obj

## Dependencies (1)

- [is-plain-obj](https://npm.io/package/is-plain-obj.md) ^2.1.0

## Recent versions

- 2.0.0 (latest) — 2020-10-07
- 1.0.3 — 2020-10-06
- 1.0.2 — 2020-10-05
- 1.0.1 — 2020-10-05
- 1.0.0 — 2020-10-05

## README

# flatify-obj ![build](https://travis-ci.com/RocktimSaikia/flatify-obj.svg?branch=master) ![license](https://img.shields.io/github/license/rocktimsaikia/flatify-obj)

> Flatten nested javascript objects into a single-depth object.

## Install
```bash
npm install flatify-obj
```

## Usage

 ```js
    const flatifyObject = require('flatify-obj');

    flatifyObject({foo: {bar: {unicorn: '🦄'}}})
    //=> { 'foo.bar.unicorn': '🦄' }

    flatifyObject({foo: {unicorn: '🦄'}, bar: 'unicorn'}, {onlyLeaves: true});
    //=> {unicorn: '🦄', bar: 'unicorn'}
 ```

## API

### flatifyObject(object, options?)

#### object

Type: `object`<br>
Object to flatten


#### options

##### onlyLeaves

Type: `boolean`<br>
Default: `false`

Removes the parent property and only returns the leaf nodes of the object


## Support

<a href="https://www.buymeacoffee.com/7BdaxfI"><img src="https://user-images.githubusercontent.com/33410545/91206759-48d5d180-e725-11ea-93b5-754d98c007af.png" height="60px"/></a>

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