dankogai / js-combinatorics

power set, combination, permutation and more in JavaScript
MIT License
742 stars 97 forks source link

var a = require('js-combinatorics') does not work #50

Closed ZodsPlan closed 6 years ago

ZodsPlan commented 6 years ago

using the npm version of this module does not work. The combinatorics.js file does not seem to have an export statement and perhaps that is causing the problem?

papb commented 6 years ago

You must be mistaken. Works perfectly for me:

const combinatorics = require("js-combinatorics");
const items = combinatorics.permutation([0,1,2]).toArray();
console.log(items.join("|"));

Outputs 0,1,2|0,2,1|1,0,2|1,2,0|2,0,1|2,1,0 as expected.