{"_id":"array-range","_rev":"4109494","name":"array-range","description":"creates a new array with given range","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"time":{"modified":"2026-01-23T00:54:09.000Z","created":"2014-11-09T18:25:32.581Z","1.0.1":"2014-11-09T18:27:50.184Z","1.0.0":"2014-11-09T18:25:32.581Z"},"users":{},"author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"repository":{"type":"git","url":"git://github.com/mattdesl/array-range.git"},"versions":{"1.0.1":{"name":"array-range","version":"1.0.1","description":"creates a new array with given range","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{},"devDependencies":{"tape":"^3.0.2"},"scripts":{"test":"node test.js"},"keywords":["filled","array","fill","list","dense","range","functional"],"repository":{"type":"git","url":"git://github.com/mattdesl/array-range.git"},"homepage":"https://github.com/mattdesl/array-range","bugs":{"url":"https://github.com/mattdesl/array-range/issues"},"gitHead":"d8b6fbdfc29caf846be02229325dfb4967f1dcd6","_id":"array-range@1.0.1","_shasum":"f56e46591843611c6a56f77ef02eda7c50089bfc","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.32","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"dist":{"shasum":"f56e46591843611c6a56f77ef02eda7c50089bfc","size":2062,"noattachment":false,"key":"/array-range/-/array-range-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/array-range/download/array-range-1.0.1.tgz"},"directories":{},"publish_time":1415557670184,"_hasShrinkwrap":false,"_cnpm_publish_time":1415557670184,"_cnpmcore_publish_time":"2021-12-16T20:02:58.502Z"},"1.0.0":{"name":"array-range","version":"1.0.0","description":"creates a new array with given range","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{},"devDependencies":{"tape":"^3.0.2"},"scripts":{"test":"node test.js"},"keywords":["filled","array","fill","list","dense","range","functional"],"repository":{"type":"git","url":"git://github.com/mattdesl/array-range.git"},"homepage":"https://github.com/mattdesl/array-range","bugs":{"url":"https://github.com/mattdesl/array-range/issues"},"gitHead":"63f0fa2cef3d3f50b9a9b67c79a72c65cf3e7874","_id":"array-range@1.0.0","_shasum":"a91942167fd6d16befa5b3afa84502d67b0adaff","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.32","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"dist":{"shasum":"a91942167fd6d16befa5b3afa84502d67b0adaff","size":2033,"noattachment":false,"key":"/array-range/-/array-range-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/array-range/download/array-range-1.0.0.tgz"},"directories":{},"publish_time":1415557532581,"_hasShrinkwrap":false,"_cnpm_publish_time":1415557532581,"_cnpmcore_publish_time":"2021-12-16T20:02:58.692Z"}},"readme":"# array-range\n\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\nTiny module to create a new dense array with the specified range. \n\n```js\nvar range = require('array-range')\nrange(3)       // -> [ 0, 1, 2 ]\nrange(1, 4)    // -> [ 1, 2, 3 ]\n```\n\nMainly useful for functional programming. ES6 examples:  \n\n```js\nvar array = require('array-range')\n\narray(5).map( x => x*x )\n// -> [ 0, 1, 4, 9, 16 ]\n\narray(2, 10).filter( x => x%2===0 )\n// -> [ 2, 4, 6, 8 ]\n```\n\nIt can also be useful for creating a fixed size dense array. Cleaner than `apply` and does not create an intermediate array:  \n\n```js\narray(5)\n\n//vs.\n\nArray.apply(null, new Array(5))\n```\n\n## Usage\n\n[![NPM](https://nodei.co/npm/array-range.png)](https://nodei.co/npm/array-range/)\n\n#### `array(start, end)`\n\nCreates a new dense array with a length of `end-start` elements. `start` is inclusive, `end` is exclusive. Negative values also work, e.g. `range(-10, 10)`\n\n#### `array(len)`\n\nCreates a new dense array with `len` number of elements, from zero to `len-1`. \n\nIf `len` is unspecified, it defaults to zero (empty array). \n\n## License\n\nMIT, see [LICENSE.md](http://github.com/mattdesl/array-range/blob/master/LICENSE.md) for details.\n","_attachments":{},"homepage":"https://github.com/mattdesl/array-range","bugs":{"url":"https://github.com/mattdesl/array-range/issues"},"license":"MIT"}