{"_id":"collection-map","_rev":"75772","name":"collection-map","description":"Returns an array of mapped values from an array or object.","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T10:24:31.000Z","created":"2015-06-07T13:58:22.406Z","1.0.0":"2017-03-02T13:51:43.378Z","0.1.0":"2015-06-07T13:58:22.406Z"},"users":{"rocket0191":true},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/collection-map.git"},"versions":{"1.0.0":{"name":"collection-map","description":"Returns an array of mapped values from an array or object.","version":"1.0.0","homepage":"https://github.com/jonschlinkert/collection-map","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/collection-map.git"},"bugs":{"url":"https://github.com/jonschlinkert/collection-map/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"arr-map":"^2.0.2","for-own":"^1.0.0","make-iterator":"^1.0.0"},"devDependencies":{"gulp-format-md":"^0.1.11","mocha":"^3.2.0"},"keywords":["collection","map"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["arr-flatten","arr-map","for-in","for-own"]},"lint":{"reflinks":true}},"gitHead":"5fa4e2863fad0a97fdb6d0f08d0ef573ec6a61ee","_id":"collection-map@1.0.0","_shasum":"aea0f06f8d26c780c2b75494385544b2255af18c","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.6.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"aea0f06f8d26c780c2b75494385544b2255af18c","size":2958,"noattachment":false,"key":"/collection-map/-/collection-map-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/collection-map/download/collection-map-1.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/collection-map-1.0.0.tgz_1488462701472_0.30760873341932893"},"directories":{},"publish_time":1488462703378,"_cnpm_publish_time":1488462703378,"_hasShrinkwrap":false},"0.1.0":{"name":"collection-map","description":"Returns an array of mapped values from an array or object.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/collection-map","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/collection-map.git"},"bugs":{"url":"https://github.com/jonschlinkert/collection-map/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"arr-map":"^2.0.0","get-values":"^0.1.0","is-plain-object":"^2.0.1","make-iterator":"^0.1.1"},"devDependencies":{"mocha":"*"},"keywords":[],"_id":"collection-map@0.1.0","_shasum":"4cff91d25108d79f4edeecce6ecee3e488f267c2","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"4cff91d25108d79f4edeecce6ecee3e488f267c2","size":2315,"noattachment":false,"key":"/collection-map/-/collection-map-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/collection-map/download/collection-map-0.1.0.tgz"},"directories":{},"publish_time":1433685502406,"_cnpm_publish_time":1433685502406,"_hasShrinkwrap":false}},"readme":"# collection-map [![NPM version](https://img.shields.io/npm/v/collection-map.svg?style=flat)](https://www.npmjs.com/package/collection-map) [![NPM monthly downloads](https://img.shields.io/npm/dm/collection-map.svg?style=flat)](https://npmjs.org/package/collection-map)  [![NPM total downloads](https://img.shields.io/npm/dt/collection-map.svg?style=flat)](https://npmjs.org/package/collection-map) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/collection-map.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/collection-map)\n\n> Returns an array of mapped values from an array or object.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save collection-map\n```\n\nInspired by the [collections/map](http://moutjs.com/) util in mout.\n\n## Usage\n\n```js\nvar map = require('collection-map');\n```\n\n### objects\n\n```js\nvar res = map({a: 'foo', b: 'bar', c: 'baz'}, function(item, key, obj) {\n  return item;\n});\nconsole.log(res);\n// => ['foo', 'bar', 'baz']\n\nvar res = map({a: 'foo', b: 'bar', c: 'baz'}, function(item, key, obj) {\n  return key;\n});\nconsole.log(res);\n// => ['a', 'b', 'c']\n```\n\n### arrays\n\n```js\nvar res = map(['foo', 'bar', 'baz'], function(item, index, array) {\n  return item;\n});\nconsole.log(res);\n// => ['foo', 'bar', 'baz']\n\nvar res = map(['foo', 'bar', 'baz'], function(item, index, array) {\n  return index;\n});\nconsole.log(res);\n// => [0, 1, 2]\n```\n\n### strings\n\nA string may be passed as the second argument, for getting properties:\n\n```js\nvar obj = {\n  a: {aaa: 'one', bbb: 'four', ccc: 'seven'},\n  b: {aaa: 'two', bbb: 'five', ccc: 'eight'},\n  c: {aaa: 'three', bbb: 'six', ccc: 'nine'}\n};\n\nconsole.log(map(obj, 'aaa'));\n// => ['one', 'two', 'three']\n\nvar array = [obj.a, obj.b, obj.c];\nconsole.log(map(array, 'bbb'));\n// => ['four', 'five', 'six']\n```\n\n### thisArg\n\nInvocation context may be passed as the last argument.\n\n```js\nvar array = ['a', 'b', 'c'];\nvar ctx = {a: 'aaa', b: 'bbb', c: 'ccc'};\n\nvar res = map(array, function(item, index, array) {\n  return this[item];\n}, ctx);\n\nconsole.log(res);\n// => ['aaa', 'bbb', 'ccc']\n```\n\n## About\n\n### Related projects\n\n* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten \"Recursively flatten an array or arrays. This is the fastest implementation of array flatten.\")\n* [arr-map](https://www.npmjs.com/package/arr-map): Faster, node.js focused alternative to JavaScript's native array map. | [homepage](https://github.com/jonschlinkert/arr-map \"Faster, node.js focused alternative to JavaScript's native array map.\")\n* [for-in](https://www.npmjs.com/package/for-in): Iterate over the own and inherited enumerable properties of an object, and return an object… [more](https://github.com/jonschlinkert/for-in) | [homepage](https://github.com/jonschlinkert/for-in \"Iterate over the own and inherited enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js\")\n* [for-own](https://www.npmjs.com/package/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) | [homepage](https://github.com/jonschlinkert/for-own \"Iterate over the own enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Building docs\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n### Running tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.3, on March 02, 2017._","_attachments":{},"homepage":"https://github.com/jonschlinkert/collection-map","bugs":{"url":"https://github.com/jonschlinkert/collection-map/issues"},"license":"MIT"}