{"name":"fast-cartesian","version":"7.2.0","type":"module","exports":"./build/src/main.js","main":"./build/src/main.js","types":"./build/src/main.d.ts","scripts":{"test":"gulp test"},"description":"Fast cartesian product","keywords":["cartesian","cartesian-product","performance","sets","functional-programming","functional","product","iterable","algorithm","data-structures","es6","javascript","typescript","library","nodejs","lodash","lodash-fp","cartesian-products","combinatorics","combinations"],"license":"Apache-2.0","homepage":"https://www.github.com/ehmicky/fast-cartesian","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":{"lib":"src","test":"test"},"devDependencies":{"@ehmicky/dev-tasks":"^1.0.84","big-cartesian":"^4.2.0","cartesian":"^1.0.1","cartesian-product":"^2.1.2","fast-cartesian-product":"^2.0.1","lodash":"^4.17.20","lodash.product":"^18.9.19","power-cartesian-product":"^0.0.6","pretty-format":"^28.1.1","spyd":"^0.5.0"},"engines":{"node":">=14.18.0"},"gitHead":"2950b042119880ed42e767a388ef700ee1537645","_id":"fast-cartesian@7.2.0","_nodeVersion":"18.7.0","_npmVersion":"8.17.0","dist":{"integrity":"sha512-X8OR1Ol8BlRGoNrWL1SJe9IZC7gSQdmHFiJrNIlReYjqswepxfF2RhLiP5O19MeZvEVIoOkrBTP4m+LsFDccEQ==","shasum":"e272fff4638fdf42786719f4220276779abad530","tarball":"http://registry-npm.ywwl.com/fast-cartesian/download/fast-cartesian-7.2.0.tgz","fileCount":6,"unpackedSize":22553,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHBZCqnzU84fZiIaboakv1UpxB4nmfqepI9Z69qeP2uoAiATnJKLPe4oeGlgtL7uf9sQo55N1gAV0hfkGOj+0AEobQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi++Q1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrpVg/+LgXmEZh0slABWrYt3Twdri/T329TvOBj1yly/sNhEI8VQ/ng\r\nZtHYl/RSgF4QK9vvMuCuEjM2EQdmKxpZt18eErB76+zW9lf5gOlu/RIMbBCh\r\n18IUbPs3e3aIIB+T8RsLkxjeRLxnDkUj80YKsKO3vbd0PQY8ttZkv81WOBy+\r\nAjBCv84xDt/qnxF2Q7Dd9HVIfJpIqeDpuBdbkW4IIvD4a/vcyMo5ZnnMVCI1\r\nBJJmwZpFDRdBsBTxtWffklsDOmvvDJQFojl9Z3SMyp9R2vukY078/45o7t6+\r\nvfTliK3udNRX1HnS5fK3S7YmL4kuSBgpD+c6O4WWbFDJ++NOa+RIeyXzjclz\r\nbsHfj2OsQHRGn+gBA0ixQ6OrLWwgF+3SaIeriPDQyO0aqEwYk8E5N1GjiXE3\r\nAf//3WQpf6pDSV7r/s+jM6I591UkMOs7YIRdNpiNxoPew/ciXFZ1ywFQDU+m\r\notGZNEbscw4fKcisvNkXat4hLRlVO5hHKYgkKGoNbWGmTZtw6MScHZK32GOq\r\nnd12nSqJbGwQhMWsBSj9RxX3sWmL+1M9GEjovKXWmWsBdC1TOBX3AYU1/rWW\r\nQz5Bk5lQBLz6/RimhYfqJiPOPgbYCn/3xwcCVDgGshBUekOS0wm5j4Dtndmj\r\nPGUTTQ0ZHlMvkb2tPauie7xL09RK8BBUGos=\r\n=GZVK\r\n-----END PGP SIGNATURE-----\r\n","size":7861,"noattachment":false,"key":"/fast-cartesian/-/fast-cartesian-7.2.0.tgz"},"_npmUser":{"name":"ehmicky","email":"ehmicky@gmail.com"},"maintainers":[{"name":"ehmicky","email":"ehmicky@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fast-cartesian_7.2.0_1660675125334_0.6969363376658853"},"_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":1660675125560,"_cnpm_publish_time":1660675125560,"dist-tags":{"latest":"9.0.1"}}