node package manager

split-props

split-props

Creates an array of objects reducing property values by index successively

Build Status npm version

Installation

Download node at nodejs.org and install it, if you haven't already.

npm install split-props --save

Description

Loops through the object multiple times (returning an array of objects) mapping the next value from each property to the property's key.

Usage

// require module 
var splitProps = require('split-props');
 
splitProps({
  a: ['a', 'b', 'c'],
  b: [2, 3]
})
 
/* returns [
  { a: 'a', b: 2 },
  { a: 'b', b: 3 },
  { a: 'c', b: undefined }
*/
 

License

MIT