This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

combinations-algo
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Combinations Algo

This is a repository for the package combinations-algo;

This package uses a generator to get combinations over a function so you can get the next combination when needed instead of blocking your code awaiting a huge array of possible combinations.

❔ How to use

Make sure you install the package:

 $ npm i combinations-algo

Then simply:

import { getCombinations } from "combinations-algo";

const input = [1,2];
const firstCombination = getCombinations(input).next();
console.log(firstCombination); // [1]

🗺 Planned features

  • [ ] Getting combinations largest to smallest
  • [ ] Normal function for getting all combinations (for the times you do need them all at once)
  • [ ] Jumping to a certain index (the N-th combination)
  • [ ] Jumping to a certain size

If you want any other features, feel free to post them here!

Package Sidebar

Install

npm i combinations-algo

Weekly Downloads

4

Version

1.0.2

License

MIT

Unpacked Size

3.51 kB

Total Files

5

Last publish

Collaborators

  • mauritswilke