divvy

Divvies up an object's values into individual tuples

npm install divvy
12 downloads in the last week
24 downloads in the last month

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' } ]
*/
npm loves you