{"name":"fast-cartesian","version":"5.1.0","main":"build/src/main.js","scripts":{"test":"gulp test"},"husky":{"hooks":{"pre-push":"gulp -LL 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.31.79","ava":"^3.15.0","big-cartesian":"^2.0.0","cartesian":"^1.0.1","cartesian-product":"^2.1.2","fast-cartesian-product":"^1.0.3","gulp":"^4.0.2","husky":"^4.3.6","is-ci":"^2.0.0","lodash":"^4.17.20","lodash.product":"^18.9.19","power-cartesian-product":"^0.0.6","pretty-format":"^26.6.2","spyd":"^0.3.1"},"engines":{"node":">=10.17.0"},"gitHead":"5191fcd476daf50306f96fc926f496d03219faee","_id":"fast-cartesian@5.1.0","_nodeVersion":"15.6.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-sZqtZoSpvB64whoAfZYaHY2EMF4yX039MlXoL7UpXpy38OxaN2ZJcZbS1qu7hsEkPrrReqTi0EBrfx5bd+HNBQ==","shasum":"496ff07b4d60d9e4ba6888d0f04a97b2115f4aca","tarball":"http://registry-npm.ywwl.com/fast-cartesian/download/fast-cartesian-5.1.0.tgz","fileCount":12,"unpackedSize":30814,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBs6pCRA9TVsSAnZWagAADPMP/2TRVBRB3bUiEg7Jjan7\nM05jWM3+IsXee0DrXrtAimFmOHiKkSniwhyjg9SKxVzGJt89ExgTPAu09CgR\nIx4+QP6eg4P5adEfIfeHED3M9K/V5mGx3zSTMBQuX/KX2ifQj93NwQERFjkg\n9sQqDLHOpFyItICN/NsC1kq7zUKEJjmp+X964zkkPBP4p+07LTOlWGmnyRDS\nraeXAOom64baabjBokW9Gm13wugvX6hMKcrQEJ4xBT48E7Gbh7mYnvOGYyZw\n5BnE6R2LlFKnAXcnezKzhFOsJduLOflI7va/GUvHxHoC8GWAoPlodbRWqCp9\nHulY0dHKdYUwgUmfjIxrRaySjnKa3JBsMxF3G6Pk6ivSUwCxcczsnrhZrJEg\nxs7XnA/ETqXCh7l3fii0YOf+6AFALH4vr4v0PVjX14DeyBD08zsCMmC8u4i+\nOdPrHH671mrpBrVyloEnXtlPJ7+qLZQZQ4uVBKQSOZgbobFeLKGcMLbDzfTU\nqYcnT9qYiemvpQxtlVk3c72Da2cLqQo10Z7pgd6bPKHbPg2LE6qOroyv806b\nSUjEVlsOe/FMSF2E8yTgAFOhP/IGHE76ZpwlQdgK3qxWrcICInXRse2EOJ1A\n8SL7yhlDCi2sIGGUST+0+NmApevq5Nhr9NgGg93QH9sJsfb79rTTddSDhRWq\naytH\r\n=akI3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHqF/eUF/H7yZcLyafJh5+l5h7elRHciZmsEWUKbA0F0AiBJ4Xtlb+nOuHyoXf1GcCnynJMsBboAFd5+9Kk7iNzLcw=="}],"size":10748,"noattachment":false,"key":"/fast-cartesian/-/fast-cartesian-5.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_5.1.0_1611058857230_0.6452641072116125"},"_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":1611058857378,"_cnpm_publish_time":1611058857378,"dist-tags":{"latest":"9.0.1"}}