string-permutation
Find all permutations of a string by a given length.
Install
$ npm install --save string-permutation
Usage
const permutation = //=> ['aa', 'ab', 'ba', 'bb'] //=> ['a', 'b', 'aa', 'ab', 'ba', 'bb'] const alphabet = 'abcdefghijklmnopqrstuvwxyz'/**[ 'aa', 'ab', 'ac', ... 'zx', 'zy', 'zz']*/
API
stringPermutation(input, [options])
input
Type: string
The allowed characters.
options
Type: number
object
When it's a number
we treat it as the options.maxSize
maxSize
The size of each item in the result.
recursive
Including the items whose length is smaller than maxSize
.
License
MIT © EGOIST