obj-numeric

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i obj-numeric

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • bendrucker