{"name":"fast-cartesian","version":"6.1.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","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"},"devDependencies":{"@ehmicky/dev-tasks":"^1.0.57","big-cartesian":"^3.0.1","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":"^27.4.2","spyd":"^0.4.0","tsd":"^0.19.0"},"engines":{"node":">=12.20.0"},"gitHead":"21afdc14a5709f6eebcfe4e53ffa991719a07862","_id":"fast-cartesian@6.1.0","_nodeVersion":"17.2.0","_npmVersion":"8.2.0","dist":{"integrity":"sha512-FHxvrmsAGV4ifDeiSEdVKyzFr12krd/NW5ou+C1FjRV+h3E0GM+c6eeZKpv+iR0IPpB2TYabBp6xrM1s/2dGJA==","shasum":"daa334e52034e51d94613883b4da54e4c6ded2b7","tarball":"http://registry-npm.ywwl.com/fast-cartesian/download/fast-cartesian-6.1.0.tgz","fileCount":10,"unpackedSize":29246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhq61ZCRA9TVsSAnZWagAA4tkP/jJUsp0T+5VmKzocvlgH\nTLDisINZLCa32S6/V3G6LnCPHxobKPyl66isInhav54q86Cr/uSQZTUneUVY\nZKrzs2XDARcVh1JcjhvoTN5W+xgFNKA8HjWpPFGmmSEGKfn7PGz21Q1r+RJJ\nAcP5Iz/0evdkZJO47721wiSHAQAWsvkDY1qFtOBAiukylKPPyfaqYCabovbW\nNBtR2g0VXjUF9mnui1VhLr1PubvcriGB15N3H0TOmcucc5CeYBO7j1iPkOVF\nWBAU2fy628g3onsEulDScuteh2pTjPHVmYB2mOJhb55ZFphl1lCNLTWMY7OL\nQ1jsclIBK4G/C6O+++2Ju6953E1EPyhNT8ZbHYxzHYwVhObMq+v6Z+k9GrgX\nT6aTN6DmsTn0u77tZYHmj8etLLBVS1Zbx6+VQdlLvCZBwno6QF72cbk09vMX\nMCc/R6CQbEOXsQPG4WtMmBy83II1QusSh4BF/6vxVdYSV26HaRhSfBYEl+r+\n/sLWgUEuM0TtreBrqX3HlYDXm1J0yLwdtc0cr10r2HSvKmRsJnnViUiL0F97\n4438wle2STHerFg6AzqzA0JUB41IWQDF9k8iWn8CTHj1kMwIN2WeQwDGxFfB\n2RaebdL4UtnZ9t2UHtpfLMB2Kv6ftQ1zhSk90tAQ2y/UNUr3joIct9v0LUEB\nk00G\r\n=cPtE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDyk5dNUCAleD4FKRvk9HXBVoId2mStIZlwEawF1kFi6AiEA2WgfHFNC9UhsCgk1n23muB6tojs4mdzRHfZwJO93TqI="}],"size":10086,"noattachment":false,"key":"/fast-cartesian/-/fast-cartesian-6.1.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_6.1.0_1638640985689_0.009480818014511838"},"_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":1638640985878,"_cnpm_publish_time":1638640985878,"dist-tags":{"latest":"9.0.1"}}