{"name":"group-array","description":"Group array of objects into lists.","version":"0.3.4","homepage":"https://github.com/doowb/group-array","author":{"name":"Brian Woodward","url":"https://github.com/doowb"},"contributors":[{"name":"Brian Woodward","email":"brian.woodward@gmail.com","url":"https://twitter.com/doowb"},{"name":"Chris Kirk","url":"http://www.chrispkirk.com"},{"name":"Jon Schlinkert","email":"jon.schlinkert@sellside.com","url":"http://twitter.com/jonschlinkert"}],"repository":{"type":"git","url":"git+https://github.com/doowb/group-array.git"},"bugs":{"url":"https://github.com/doowb/group-array/issues"},"license":"MIT","main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"arr-flatten":"^1.0.1","for-own":"^0.1.4","get-value":"^2.0.6","kind-of":"^3.1.0","split-string":"^1.0.1","union-value":"^1.0.1"},"devDependencies":{"gulp-format-md":"^0.1.11","mocha":"^3.2.0","should":"^11.2.0"},"keywords":["array","group","item","list","nested","prop","properties","property"],"verb":{"toc":true,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["arr-flatten","get-value","group-object","union-value"]},"reflinks":["verb","verb-generate-readme"],"lint":{"reflinks":true}},"gitHead":"dc9309fe7f29e69b9736e25f6ead9895d33ec583","_id":"group-array@0.3.4","_nodeVersion":"10.15.2","_npmVersion":"6.9.0","_npmUser":{"name":"doowb","email":"brian.woodward@gmail.com"},"dist":{"integrity":"sha512-YAmNsgsi1uQ7Ai3T4FFkMoskqbLEUPRajAmrn8FclwZQQnV98NLrNWjQ3n2+i1pANxdO3n6wsNEkKq5XrYy0Ow==","shasum":"7ce02db67169ef2db472f1323c255ea5661b3748","tarball":"http://registry-npm.ywwl.com/group-array/download/group-array-0.3.4.tgz","fileCount":4,"unpackedSize":14318,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdLSqFCRA9TVsSAnZWagAAxwsP/Atq9LNOF4JCk7u0p+fx\nkHXqRsW2P0Y3mcLW654hDFpXavJnSauruqq6TEbU1OVbwd44SD3spZbb+/yO\nnvOo4HVhmZ7JVHAMxLPD7w+6znY45otvu4q4szSqNylAoTYywhWalElHFOyK\n4tSeo4kuEs5D8gVv7anC4e9JFnl4XZRTT+yIxJ/M5qv64q61OumhJOfNkxaO\nHsLjAMxhhZ+CidGT4sOmRU4OIFmb6R+m6O0Wao/4KswSxMWLu84oIWfv3Fyw\neEBsB+Nf/YuluUFscedH+EIvEqKNSNEoryx05cJ8rZuFnhfdP9nzlHdNBczA\n0c17A8NgXBzN1KNW8gKiYuHdnmZ1Iv/0xnPmnMoRlc5dGV44OqBVwl1QBI8n\nfDe7cWCw1UKZxr2TjATURqxCd6cCsKMyWpoPmeNvnqgSuqQ6s9bJHXlfLUp0\nHUnXQmqwcUiO5WUP9oYDctYxDoBB1J9IFjTlXWVu2U1Wf5+FOHiKRqM76XCZ\nbaDmGeOaJPp9ttXC/5s3dJgX1d1Dme9RvEU8IWjK2EXZpndIoYup5RWvTLwM\n/stqdF+Ml3OnyPp+r15hbLy4BJNGFH6LFB9LViDR7eUws6TqttvTSlkUWh6s\nuJHGT/WnwWo5NQJUdXGDEqVEPE2PSaZJ9aIPYdRCxvPShNbHc5+5CfRAKiZk\nf0Pw\r\n=Uhx2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH80EQ6TU+7ZhzmzQZZwhFCbL9GLNXA5rGaEqpp7Ib+KAiAYyJByEwYRbN2z4FAJOYFJ2Tk8NAWExxwB62Jp8NRxsw=="}],"size":3962,"noattachment":false,"key":"/group-array/-/group-array-0.3.4.tgz"},"maintainers":[{"email":"brian.woodward@gmail.com","name":"doowb"},{"email":"github@sellside.com","name":"jonschlinkert"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/group-array_0.3.4_1563241092848_0.9617923454031452"},"_hasShrinkwrap":false,"readme":"# group-array [![NPM version](https://img.shields.io/npm/v/group-array.svg?style=flat)](https://www.npmjs.com/package/group-array) [![NPM monthly downloads](https://img.shields.io/npm/dm/group-array.svg?style=flat)](https://npmjs.org/package/group-array) [![NPM total downloads](https://img.shields.io/npm/dt/group-array.svg?style=flat)](https://npmjs.org/package/group-array) [![Linux Build Status](https://img.shields.io/travis/doowb/group-array.svg?style=flat&label=Travis)](https://travis-ci.org/doowb/group-array)\n\n> Group array of objects into lists.\n\nPlease consider following this project's author, [Brian Woodward](https://github.com/doowb), and consider starring the project to show your :heart: and support.\n\n- [Install](#install)\n- [Usage](#usage)\n- [Examples](#examples)\n- [About](#about)\n\n_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save group-array\n```\n\n## Usage\n\n```js\nvar groupArray = require('group-array');\n```\n\n## Examples\n\n```js\nvar arr = [\n  {tag: 'one', content: 'A'},\n  {tag: 'one', content: 'B'},\n  {tag: 'two', content: 'C'},\n  {tag: 'two', content: 'D'},\n  {tag: 'three', content: 'E'},\n  {tag: 'three', content: 'F'}\n];\n\n// group by the `tag` property\ngroupArray(arr, 'tag');\n```\n\n**results in:**\n\n```js\n{\n  one: [\n    {tag: 'one', content: 'A'},\n    {tag: 'one', content: 'B'}\n  ],\n  two: [\n    {tag: 'two', content: 'C'},\n    {tag: 'two', content: 'D'}\n  ],\n  three: [\n    {tag: 'three', content: 'E'},\n    {tag: 'three', content: 'F'}\n  ]\n}\n```\n\n**Group by multiple, deeply nested properties**\n\n```js\n// given an array of object, like blog posts...\nvar arr = [\n  { data: { year: '2016', tag: 'one', month: 'jan', day: '01'}, content: '...'},\n  { data: { year: '2016', tag: 'one', month: 'jan', day: '01'}, content: '...'},\n  { data: { year: '2016', tag: 'one', month: 'jan', day: '02'}, content: '...'},\n  { data: { year: '2016', tag: 'one', month: 'jan', day: '02'}, content: '...'},\n  { data: { year: '2016', tag: 'one', month: 'feb', day: '10'}, content: '...'},\n  { data: { year: '2016', tag: 'one', month: 'feb', day: '10'}, content: '...'},\n  { data: { year: '2016', tag: 'one', month: 'feb', day: '12'}, content: '...'},\n  { data: { year: '2016', tag: 'one', month: 'feb', day: '12'}, content: '...'},\n  { data: { year: '2016', tag: 'two', month: 'jan', day: '14'}, content: '...'},\n  { data: { year: '2016', tag: 'two', month: 'jan', day: '14'}, content: '...'},\n  { data: { year: '2016', tag: 'two', month: 'jan', day: '16'}, content: '...'},\n  { data: { year: '2016', tag: 'two', month: 'jan', day: '16'}, content: '...'},\n  { data: { year: '2016', tag: 'two', month: 'feb', day: '18'}, content: '...'},\n  { data: { year: '2017', tag: 'two', month: 'feb', day: '18'}, content: '...'},\n  { data: { year: '2017', tag: 'two', month: 'feb', day: '10'}, content: '...'},\n  { data: { year: '2017', tag: 'two', month: 'feb', day: '10'}, content: '...'},\n  { data: { year: '2017', tag: 'three', month: 'jan', day: '01'}, content: '...'},\n  { data: { year: '2017', tag: 'three', month: 'jan', day: '01'}, content: '...'},\n  { data: { year: '2017', tag: 'three', month: 'jan', day: '02'}, content: '...'},\n  { data: { year: '2017', tag: 'three', month: 'jan', day: '02'}, content: '...'},\n  { data: { year: '2017', tag: 'three', month: 'feb', day: '01'}, content: '...'},\n  { data: { year: '2017', tag: 'three', month: 'feb', day: '01'}, content: '...'},\n  { data: { year: '2017', tag: 'three', month: 'feb', day: '02'}, content: '...'},\n  { data: { year: '2017', tag: 'three', month: 'feb', day: '02'}, content: '...'}\n]\n```\n\nPass a list or array of properties:\n\n```js\ngroupArray(arr, 'data.year', 'data.tag', 'data.month', 'data.day');\n```\n\n**Results in something like this: (abbreviated)**\n\n```js\n{ '2016': \n   { one: \n      { jan: \n         { '01': \n            [ { data: { year: '2016', tag: 'one', month: 'jan', day: '01' },\n                content: '...' },\n              { data: { year: '2016', tag: 'one', month: 'jan', day: '01' },\n                content: '...' } ],\n           '02': \n            [ { data: { year: '2016', tag: 'one', month: 'jan', day: '02' },\n                content: '...' },\n              { data: { year: '2016', tag: 'one', month: 'jan', day: '02' },\n                content: '...' } ] },\n        feb: \n         { '10': \n            [ { data: { year: '2016', tag: 'one', month: 'feb', day: '10' },\n                content: '...' },\n              { data: { year: '2016', tag: 'one', month: 'feb', day: '10' },\n                content: '...' } ],\n           '12': \n            [ { data: { year: '2016', tag: 'one', month: 'feb', day: '12' },\n                content: '...' },\n              { data: { year: '2016', tag: 'one', month: 'feb', day: '12' },\n                content: '...' } ] } },\n     two: \n      { jan: \n         { '14': \n            [ { data: { year: '2016', tag: 'two', month: 'jan', day: '14' },\n                content: '...' },\n              { data: { year: '2016', tag: 'two', month: 'jan', day: '14' },\n                content: '...' } ],\n           '16': \n            [ { data: { year: '2016', tag: 'two', month: 'jan', day: '16' },\n                content: '...' },\n              { data: { year: '2016', tag: 'two', month: 'jan', day: '16' },\n                content: '...' } ] },\n        feb: \n         { '18': \n            [ { data: { year: '2016', tag: 'two', month: 'feb', day: '18' },\n                content: '...' } ] } } },\n  '2017': \n   { two: \n      { feb: \n         { '10': \n            [ { data: { year: '2017', tag: 'two', month: 'feb', day: '10' },\n                content: '...' },\n              { data: { year: '2017', tag: 'two', month: 'feb', day: '10' },\n                content: '...' } ],\n           '18': \n            [ { data: { year: '2017', tag: 'two', month: 'feb', day: '18' },\n                content: '...' } ] } },\n     three: \n      { jan: \n         { '01': \n            [ { data: { year: '2017', tag: 'three', month: 'jan', day: '01' },\n                content: '...' },\n              { data: { year: '2017', tag: 'three', month: 'jan', day: '01' },\n                content: '...' } ],\n           '02': \n            [ { data: { year: '2017', tag: 'three', month: 'jan', day: '02' },\n                content: '...' },\n              { data: { year: '2017', tag: 'three', month: 'jan', day: '02' },\n                content: '...' } ] },\n        feb: \n         { '01': \n            [ { data: { year: '2017', tag: 'three', month: 'feb', day: '01' },\n                content: '...' },\n              { data: { year: '2017', tag: 'three', month: 'feb', day: '01' },\n                content: '...' } ],\n           '02': \n            [ { data: { year: '2017', tag: 'three', month: 'feb', day: '02' },\n                content: '...' },\n              { data: { year: '2017', tag: 'three', month: 'feb', day: '02' },\n                content: '...' } ] } } } }\n```\n\n## About\n\n<details>\n<summary><strong>Contributing</strong></summary>\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n</details>\n\n<details>\n<summary><strong>Running Tests</strong></summary>\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</details>\n\n<details>\n<summary><strong>Building docs</strong></summary>\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</details>\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. | [homepage](https://github.com/jonschlinkert/arr-flatten \"Recursively flatten an array or arrays.\")\n* [get-value](https://www.npmjs.com/package/get-value): Use property paths like 'a.b.c' to get a nested value from an object. Even works… [more](https://github.com/jonschlinkert/get-value) | [homepage](https://github.com/jonschlinkert/get-value \"Use property paths like 'a.b.c' to get a nested value from an object. Even works when keys have dots in them (no other dot-prop library can do this!).\")\n* [group-object](https://www.npmjs.com/package/group-object): Group object keys and values into lists. | [homepage](https://github.com/doowb/group-object \"Group object keys and values into lists.\")\n* [union-value](https://www.npmjs.com/package/union-value): Set an array of unique values as the property of an object. Supports setting deeply… [more](https://github.com/jonschlinkert/union-value) | [homepage](https://github.com/jonschlinkert/union-value \"Set an array of unique values as the property of an object. Supports setting deeply nested properties using using object-paths/dot notation.\")\n\n### Contributors\n\n| **Commits** | **Contributor** |  \n| --- | --- |  \n| 32 | [doowb](https://github.com/doowb) |  \n| 13 | [jonschlinkert](https://github.com/jonschlinkert) |  \n| 2  | [johlym](https://github.com/johlym) |  \n| 1  | [cperryk](https://github.com/cperryk) |  \n\n### Author\n\n**Brian Woodward**\n\n* [GitHub Profile](https://github.com/doowb)\n* [Twitter Profile](https://twitter.com/doowb)\n* [LinkedIn Profile](https://linkedin.com/in/woodwardbrian)\n\n### License\n\nCopyright © 2019, [Brian Woodward](https://github.com/doowb).\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.8.0, on July 22, 2019._","publish_time":1563241092996,"_cnpm_publish_time":1563241092996,"dist-tags":{"latest":"1.0.0"}}