https://github.com/nickytonline/b-flat
A simple object flattener/unflattener.
https://github.com/nickytonline/b-flat
Last synced: 11 months ago
JSON representation
A simple object flattener/unflattener.
- Host: GitHub
- URL: https://github.com/nickytonline/b-flat
- Owner: nickytonline
- License: mit
- Created: 2016-01-21T04:26:16.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-02-19T03:32:14.000Z (over 8 years ago)
- Last Synced: 2025-08-09T01:59:16.803Z (11 months ago)
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ♭-flat
[](https://travis-ci.org/nickytonline/b-flat)
[](https://www.npmjs.com/package/b-flat)
A simple object flattener/unflattener.
Installation
------------
`npm install b-flat`
Usage
-----
Via ES6 import from module
```
const { flatten, unflatten } from 'b-flat';
const flattenedObject = flatten({a: [1,2,3]});
console.log(flattenedObject);
console.log(unflatten(flattenedObject));
```
Via require
```
const flatten = require('b-flat').flatten;
const unflatten = require('b-flat').unflatten;
const flattenedObject = flatten({a: [1,2,3]});
console.log(flattenedObject);
console.log(unflatten(flattenedObject));
```