flatten-to-object
Flatten an array of objects to a single object
Last updated 12 years ago by scottcorgan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install flatten-to-object 
SYNC missed versions from official npm registry.

flatten-to-object

Flatten an array of objects to a single object

Install

npm install flatten-to-object --save

Usage

var flattenToObject = require('flatten-to-object');

var arr = [
  {
    key1: 'value1',
    key2: 'value2'
  },
  {
    key3: 'value3'
  }
];

console.log(flattenToObject(arr));

// OUTPUTS:
// {
//   key1: 'value1',
//   key2: 'value2',
//   key3: ''
// }

Run Tests

npm install
npm test

Current Tags

  • 1.0.0                                ...           latest (12 years ago)

1 Versions

  • 1.0.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 1
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE