1.0.0 • Published 9 years ago

obj-numeric v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

obj-numeric Build Status

Create an object with incremented numeric values from an array of keys

Install

$ npm install --save obj-numeric

Usage

var objNumeric = require('obj-numeric')

objNumeric(['foo', 'bar'])
//=> {foo: 0, bar: 1}

objNumeric(['foo', 'bar'], 1)
//=> {foo: 1, bar: 2}

API

objNumeric(keys, [offset]) -> object

keys

Required
Type: array

An array of keys to add to the output object.

offset

Type: number
Default: 0

An offset for each number.

License

MIT © Ben Drucker