{"name":"fast-cartesian","version":"4.1.0","main":"build/src/main.js","scripts":{"test":"gulp test"},"husky":{"hooks":{"pre-push":"gulp check --full"}},"description":"Fast cartesian product","keywords":["cartesian","cartesian-product","performance","sets","functional-programming","functional","product","iterable","algorithm","data-structures","es6","javascript","library","nodejs","lodash","lodashjs","lodash-fp","cartesian-products","combinatorics","combinations"],"license":"Apache-2.0","homepage":"https://git.io/fjRR4","repository":{"type":"git","url":"git+https://github.com/ehmicky/fast-cartesian.git"},"bugs":{"url":"https://github.com/ehmicky/fast-cartesian/issues"},"author":{"name":"ehmicky","email":"ehmicky@gmail.com","url":"https://github.com/ehmicky"},"directories":{"doc":"docs","lib":"src","test":"test"},"dependencies":{},"devDependencies":{"@ehmicky/dev-tasks":"^0.30.48","ava":"^2.4.0","big-cartesian":"^1.1.0","cartesian":"^1.0.1","cartesian-product":"^2.1.2","fast-cartesian-product":"^1.0.0","gulp":"^4.0.2","husky":"^3.0.9","is-ci":"^2.0.0","lodash":"^4.17.15","lodash.product":"^18.9.19","power-cartesian-product":"^0.0.4","pretty-format":"^24.9.0","spyd":"^0.2.1"},"engines":{"node":">=8.12.0"},"gitHead":"9dbd69570dc021364b1f632bab9e07c3784b17c5","_id":"fast-cartesian@4.1.0","_nodeVersion":"12.12.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-799msufMBJySkaZi0lwbyI4ZDUvGI9NcFHd9C19O3ZBexgk21B0MLldFsg5lRCUWGPCOQxEqStdgSP0wp/+hxQ==","shasum":"0e35207b80eff8c7a440bf708a4b1468dec8bf6f","tarball":"http://registry-npm.ywwl.com/fast-cartesian/download/fast-cartesian-4.1.0.tgz","fileCount":11,"unpackedSize":30908,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdpu6gCRA9TVsSAnZWagAAX50P/004/jXLeg/iuDJXVK2X\n2fcGmt45qxQj23+XN/PTCiX2AQX/+oimcrzYj/eIZJeAAdHVttbu6hpeMP6j\nz+f5knBlN3CU8/mSY6yofIDpX9qiPiqmf66PtZkgbCa/jEhsaQjhiiq6hwvu\nayh6QfcdUIObhXltizwIbn3NF5mPcqMZGMLr2J/it177ujgkr5PjNKmnKRNQ\nWJN2omi/uTyz4b7Z/7MBoYx+SjkrHh4kxwrTEIbfQpkhBVfRwJewW1v/ZPK7\nYPHk239cNh0TZK7cAxusGDLDP8La++bdqJzqTv3g9orqmAkx2TaCF8FwxWuY\nhIpfbCJB37L3wq5mUxU2Sxa/XfuinuYKjCCW5eAtauZlbIJXaaHvjCOQ+dEc\nqdZVaGLtj2s0U6tEt55p9yKDxuHAK5E8h5rS1u2x3Uel9MDWhfWw9e5hZo4C\nwMsYXL8aIgK+yQHELNDf1c6pmJ+Ao+NkJ0dSqULnrXUfqYnFj3VSAGVNp35I\nZY57N8ZTyWnvzfOC72zVw9DhaoE802b4gwCGRj/UH0/CCMTNIGcdNqJSNKhF\nV1vds1TdmFWm7PZ3ecw9nsp5cyBMtQ815prEWeARXrY5ypT/XhP2aWyoO8t3\nbExsI24henPuHkZiVCRisOTG4SI7DBFmOM0PJtAnQePHWMyzNnw/kqCGyO6g\n013Y\r\n=wMqi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDF9b4A7SBjODIAg+govuAk0GVzA9dSdmk6Z2pY6r69cAIhAIc/QzFFcbAaeD7IS0urJIxXlYnLRn3xzWcu+6YntNoU"}],"size":10778,"noattachment":false,"key":"/fast-cartesian/-/fast-cartesian-4.1.0.tgz"},"maintainers":[{"name":"ehmicky","email":"ehmicky@gmail.com"}],"_npmUser":{"name":"ehmicky","email":"ehmicky@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fast-cartesian_4.1.0_1571221151595_0.11634206825660365"},"_hasShrinkwrap":false,"readme":"[![Node](https://img.shields.io/badge/-Node.js-808080?logo=node.js&colorA=404040&logoColor=66cc33)](https://www.npmjs.com/package/fast-cartesian)\n[![Browsers](https://img.shields.io/badge/-Browsers-808080?logo=firefox&colorA=404040)](https://unpkg.com/fast-cartesian?module)\n[![TypeScript](https://img.shields.io/badge/-Typed-808080?logo=typescript&colorA=404040&logoColor=0096ff)](/src/main.ts)\n[![Codecov](https://img.shields.io/badge/-Tested%20100%25-808080?logo=codecov&colorA=404040)](https://codecov.io/gh/ehmicky/fast-cartesian)\n[![Minified size](https://img.shields.io/bundlephobia/minzip/fast-cartesian?label&colorA=404040&colorB=808080&logo=webpack)](https://bundlephobia.com/package/fast-cartesian)\n[![Mastodon](https://img.shields.io/badge/-Mastodon-808080.svg?logo=mastodon&colorA=404040&logoColor=9590F9)](https://fosstodon.org/@ehmicky)\n[![Medium](https://img.shields.io/badge/-Medium-808080.svg?logo=medium&colorA=404040)](https://medium.com/@ehmicky)\n\nFast cartesian product.\n\nRetrieves every possible combination between several arrays\n([cartesian product](https://en.wikipedia.org/wiki/Cartesian_product)).\n\n[Fastest](#benchmarks) available library in JavaScript.\n\nWhen producing millions of combinations or combining hundreds of arrays,\n[`big-cartesian`](https://github.com/ehmicky/big-cartesian) should be used\ninstead.\n\n# Hire me\n\nPlease\n[reach out](https://www.linkedin.com/feed/update/urn:li:activity:7117265228068716545/)\nif you're looking for a Node.js API or CLI engineer (11 years of experience).\nMost recently I have been [Netlify Build](https://github.com/netlify/build)'s\nand [Netlify Plugins](https://www.netlify.com/products/build/plugins/)'\ntechnical lead for 2.5 years. I am available for full-time remote positions.\n\n# Testimonials\n\n> We are now using this library for ourworldindata.org and have seen an almost\n> 50-fold performance increase from the naive method we used before!\n>\n> @MarcelGerber\n\n# Example\n\n```js\nimport fastCartesian from 'fast-cartesian'\n\nconsole.log(\n  fastCartesian([\n    ['red', 'blue'],\n    ['circle', 'square'],\n  ]),\n)\n// [\n//   [ 'red', 'circle' ],\n//   [ 'red', 'square' ],\n//   [ 'blue', 'circle' ],\n//   [ 'blue', 'square' ]\n// ]\n\n// Return initial indexes\nconsole.log(\n  fastCartesian(\n    [\n      ['red', 'blue'],\n      ['circle', 'square'],\n    ].map(Object.entries),\n  ),\n)\n// [\n//   [ [ '0', 'red' ], [ '0', 'circle' ] ],\n//   [ [ '0', 'red' ], [ '1', 'square' ] ],\n//   [ [ '1', 'blue' ], [ '0', 'circle' ] ],\n//   [ [ '1', 'blue' ], [ '1', 'square' ] ]\n// ]\n```\n\n# Demo\n\nYou can try this library:\n\n- either directly [in your browser](https://repl.it/@ehmicky/fast-cartesian).\n- or by executing the [`examples` files](examples/README.md) in a terminal.\n\n# Install\n\n```\nnpm install fast-cartesian\n```\n\nThis package works in both Node.js >=18.18.0 and\n[browsers](https://raw.githubusercontent.com/ehmicky/dev-tasks/main/src/browserslist).\n\nThis is an ES module. It must be loaded using\n[an `import` or `import()` statement](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c),\nnot `require()`. If TypeScript is used, it must be configured to\n[output ES modules](https://www.typescriptlang.org/docs/handbook/esm-node.html),\nnot CommonJS.\n\n# API\n\n## fastCartesian(inputs)\n\n`inputs`: `Array<Array>`\\\n_Return value_: `Array<Array>`\n\nReturns a two-dimensional `Array` where each row is a combination of `inputs`.\n\n# Benchmarks\n\nThe following [benchmarks](benchmark/tasks.js) compare the performance of this\nlibrary against alternatives\n([`big-cartesian`](https://github.com/ehmicky/big-cartesian),\n[`cx-product`](https://github.com/anywhichway/cxproduct),\n[`cartesian-product`](https://github.com/izaakschroeder/cartesian-product),\n[`fast-cartesian-product`](https://github.com/fisker/fast-cartesian-product),\n[`power-cartesian-product`](https://github.com/fisker/power-cartesian-product),\n[`cartesian`](https://github.com/alexindigo/cartesian) and\n[`lodash.product`](https://github.com/SeregPie/lodash.product)).\n\n```\n## fast-cartesian ######################\n1 array                           1.22ms\n2 arrays                          1.82ms\n4 arrays                          3.12ms\n8 arrays                          1.87ms\n16 arrays                         4.82ms\n\n## cxproduct ###########################\n1 array                           1.91ms\n2 arrays                          3.47ms\n4 arrays                          3.62ms\n8 arrays                          2.39ms\n16 arrays                         5.05ms\n\n## cartesian-product ###################\n1 array                           4.61ms\n2 arrays                          2.92ms\n4 arrays                         11.80ms\n8 arrays                         14.78ms\n16 arrays                        21.00ms\n\n## big-cartesian #######################\n1 array                           7.21ms\n2 arrays                          6.68ms\n4 arrays                          8.53ms\n8 arrays                          7.80ms\n16 arrays                        18.30ms\n\n## power-cartesian-product #############\n1 array                           6.84ms\n2 arrays                          8.54ms\n4 arrays                         12.35ms\n8 arrays                         11.78ms\n16 arrays                        18.98ms\n\n## cartesian ###########################\n1 array                           3.44ms\n2 arrays                         11.12ms\n4 arrays                         13.27ms\n8 arrays                         16.11ms\n16 arrays                        22.90ms\n\n## fast-cartesian-product ##############\n1 array                          23.04ms\n2 arrays                         24.11ms\n4 arrays                         30.46ms\n8 arrays                         45.65ms\n16 arrays                        65.12ms\n\n## lodash.product ######################\n1 array                          36.51ms\n2 arrays                         37.89ms\n4 arrays                         41.71ms\n8 arrays                         52.72ms\n16 arrays                        80.84ms\n```\n\n# Support\n\nFor any question, _don't hesitate_ to [submit an issue on GitHub](../../issues).\n\nEveryone is welcome regardless of personal background. We enforce a\n[Code of conduct](CODE_OF_CONDUCT.md) in order to promote a positive and\ninclusive environment.\n\n# Contributing\n\nThis project was made with ❤️. The simplest way to give back is by starring and\nsharing it online.\n\nIf the documentation is unclear or has a typo, please click on the page's `Edit`\nbutton (pencil icon) and suggest a correction.\n\nIf you would like to help us fix a bug or add a new feature, please check our\n[guidelines](CONTRIBUTING.md). Pull requests are welcome!\n\n<!-- Thanks go to our wonderful contributors: -->\n\n<!-- ALL-CONTRIBUTORS-LIST:START -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n  <tr>\n    <td align=\"center\"><a href=\"https://fosstodon.org/@ehmicky\"><img src=\"https://avatars2.githubusercontent.com/u/8136211?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>ehmicky</b></sub></a><br /><a href=\"https://github.com/ehmicky/fast-cartesian/commits?author=ehmicky\" title=\"Code\">💻</a> <a href=\"#design-ehmicky\" title=\"Design\">🎨</a> <a href=\"#ideas-ehmicky\" title=\"Ideas, Planning, & Feedback\">🤔</a> <a href=\"https://github.com/ehmicky/fast-cartesian/commits?author=ehmicky\" title=\"Documentation\">📖</a></td>\n    <td align=\"center\"><a href=\"https://marcelgerber.de\"><img src=\"https://avatars0.githubusercontent.com/u/2641501?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Marcel Gerber</b></sub></a><br /><a href=\"https://github.com/ehmicky/fast-cartesian/commits?author=MarcelGerber\" title=\"Code\">💻</a></td>\n    <td align=\"center\"><a href=\"https://github.com/Paulomart\"><img src=\"https://avatars.githubusercontent.com/u/4148404?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Paul Heidenreich</b></sub></a><br /><a href=\"https://github.com/ehmicky/fast-cartesian/commits?author=Paulomart\" title=\"Code\">💻</a></td>\n  </tr>\n</table>\n\n<!-- markdownlint-restore -->\n<!-- prettier-ignore-end -->\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n","publish_time":1571221151708,"_cnpm_publish_time":1571221151708,"dist-tags":{"latest":"9.0.1"}}