Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including permutater with all npm packages installed. Try it out:

var permutater = require("permutater")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

permutater v1.0.2

Permutater

Generates all possible values based on a defined length.. with or without a limit

const permutater = require('permutater');
permutater({
    characters : 'abcdefghijklmnopqrstuvwxyz0123456789'.split(''),
    length : 3
})
// ['aaa', 'aab', 'aac' ... '997', '998', '999'].length = 46656
permutater({
    charactersAt : {
        0 : ['0', '1', '2']
    },
    characters : 'abcdefghijklmnopqrstuvwxyz'.split(''),
    length : 2
})
// ['0a', '0b', '0c' ... '2x', '2y', '2z'].length = 78
permutater({
    charactersAt : {
        0 : ['a', 'b'],
        1 : ['-']
    },
    characters : 'abcdefghijklmnopqrstuvwxyz'.split(''),
    length : 3
})
// ['a-a', 'a-b', 'a-c' ... 'b-x', 'b-y', 'b-z'].length = 52
permutater({
    characters : 'abcdefghijklmnopqrstuvwxyz0123456789'.split(''),
    length : 5,
    limit : 30
})
// ['fn6p3', 'x83na', '3v20r' ... ].length = 30

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free