{"name":"big-cartesian","version":"6.1.1","type":"module","exports":{"types":"./build/src/main.d.ts","default":"./build/src/main.js"},"main":"./build/src/main.js","types":"./build/src/main.d.ts","sideEffects":false,"scripts":{"test":"gulp test"},"description":"Cartesian product for big inputs","keywords":["cartesian","cartesian-product","performance","sets","functional","functional-programming","product","iterable","algorithm","data-structures","es6","javascript","library","nodejs","lodash","lodash-fp","typescript","cartesian-products","combinatorics","combinations"],"license":"Apache-2.0","homepage":"https://www.github.com/ehmicky/big-cartesian","repository":{"type":"git","url":"git+https://github.com/ehmicky/big-cartesian.git"},"bugs":{"url":"https://github.com/ehmicky/big-cartesian/issues"},"author":{"name":"ehmicky","email":"ehmicky@gmail.com","url":"https://github.com/ehmicky"},"directories":{"lib":"src"},"devDependencies":{"@ehmicky/dev-tasks":"^3.0.33","@ehmicky/eslint-config":"^20.0.31","@ehmicky/prettier-config":"^1.0.6","test-each":"^7.0.0"},"engines":{"node":">=18.18.0"},"_id":"big-cartesian@6.1.1","gitHead":"6cf3b0a9a218c90c155bfdbfbdce15b1fa095780","_nodeVersion":"23.10.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-cvTaC0YBXZBsKfMWm7ZYUp4TshWQnwKTC2Dr7RWyE80uJlESyzQGJnG+mnI98URde7DgKOJVgNY17LqYfbbkow==","shasum":"0b9473eef7bf966c6fc35ee0970aeb80c5a5c974","tarball":"http://registry-npm.ywwl.com/big-cartesian/download/big-cartesian-6.1.1.tgz","fileCount":5,"unpackedSize":19995,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCXALNxeSXK8EuiZNRdsuXP0IB/TYA6cBb+glpFsD9f6wIhAK7W2WJjJteaenJUiw4FGmh1oXS+LzHzMmTbNUX1lZUu"}],"size":7416,"noattachment":false,"key":"/big-cartesian/-/big-cartesian-6.1.1.tgz"},"_npmUser":{"name":"ehmicky","email":"ehmicky@gmail.com"},"maintainers":[{"name":"ehmicky","email":"ehmicky@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/big-cartesian_6.1.1_1743215647116_0.5582360342816586"},"_hasShrinkwrap":false,"readme":"[![Node](https://img.shields.io/badge/-Node.js-808080?logo=node.js&colorA=404040&logoColor=66cc33)](https://www.npmjs.com/package/big-cartesian)\n[![Browsers](https://img.shields.io/badge/-Browsers-808080?logo=firefox&colorA=404040)](https://unpkg.com/big-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/big-cartesian)\n[![Minified size](https://img.shields.io/bundlephobia/minzip/big-cartesian?label&colorA=404040&colorB=808080&logo=webpack)](https://bundlephobia.com/package/big-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\nCartesian product for big inputs.\n\nRetrieves every possible combination between several arrays\n([cartesian product](https://en.wikipedia.org/wiki/Cartesian_product)):\n\n- can handle an infinite number of combinations\n- requires almost no memory\n\nThis module is perfect when you combine hundreds of arrays or when those arrays\nproduce millions of combinations. Otherwise you should use\n[`fast-cartesian`](https://github.com/ehmicky/fast-cartesian) instead as it is\nmuch faster.\n\n# Example\n\n<!-- eslint-disable fp/no-loops -->\n\n```js\nimport bigCartesian from 'big-cartesian'\n\nfor (const values of bigCartesian([\n  ['red', 'blue'],\n  ['circle', 'square'],\n])) {\n  console.log(values)\n}\n// [ 'red', 'circle' ]\n// [ 'red', 'square' ]\n// [ 'blue', 'circle' ]\n// [ 'blue', 'square' ]\n```\n\n# Install\n\n```\nnpm install big-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## bigCartesian(inputs)\n\n`inputs`: `Array<Array | Iterable | GeneratorFunction>`\\\n_Return value_:\n[`Iterable<Array>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols)\n\nIterates over each combination of `inputs`.\n\n## Limits\n\nThis works with an infinite number of combinations.\n\nArrays in JavaScript have a size limit of 4 trillions of elements. You can\nbypass this limit by using iterables or generator functions instead.\n\n<!-- eslint-disable fp/no-loops -->\n\n```js\nimport bigCartesian from 'big-cartesian'\n\nconst generator = function* () {\n  // This generator can generate an infinite number of elements\n}\n\n// Notice we pass the function itself: `generator` not `generator()`\nfor (const values of bigCartesian([['red', 'blue'], generator])) {\n  console.log(values)\n}\n```\n\n# Benchmarks\n\nSee the\n[following benchmarks](https://github.com/ehmicky/fast-cartesian#benchmarks).\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 -->\n<!--\n<table><tr><td align=\"center\"><a href=\"https://fosstodon.org/@ehmicky\"><img src=\"https://avatars2.githubusercontent.com/u/8136211?v=4\" width=\"100px;\" alt=\"ehmicky\"/><br /><sub><b>ehmicky</b></sub></a><br /><a href=\"https://github.com/ehmicky/big-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/big-cartesian/commits?author=ehmicky\" title=\"Documentation\">📖</a></td></tr></table>\n-->\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n","publish_time":1743215647369,"_cnpm_publish_time":1743215647369,"dist-tags":{"latest":"6.1.1"}}