divvy

0.0.6 • Public • Published

Divvy

A tiny npm package to split objects up conveniently.

Sometimes you want to take an object with keys, like this:

var object = {
  countries: ['United States', 'Aruba', 'Russia', 'Japan'],
  people: ['Chad', 'Joe', 'Ilyna', 'Sho']
};

...and split it up into separate 'items', if you will:

var citizens = divvy(object);
console.log(citizens); // Results in:
/*  
    [ { country: 'United States', person: 'Chad' },
      { country: 'Aruba', person: 'Joe' },
      { country: 'Russia', person: 'Ilyna' },
      { country: 'Japan', person: 'Sho' } ]
*/

Readme

Keywords

none

Package Sidebar

Install

npm i divvy

Weekly Downloads

0

Version

0.0.6

License

none

Last publish

Collaborators

  • colinyoung