Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 911 Bytes

README.md

File metadata and controls

41 lines (28 loc) · 911 Bytes

Seqstring: A sequential string generator for Node.js

This module helps you to generate sequential strings, it uses the new generator function in ES6.

Build Status

Installation

This module is only compatible with Node.js >= 5.x.x.

$ npm install seqstring

Usage

var Seqstring = require('seqstring');

Construct a generator, all the parameters are optional.

new Seqstring([Minimum length], [Maximum length], [Array of characters]);

Example using a for-loop:

var generator = new Seqstring(1, 5, ['a','b']);
for(var string of generator) {
  console.log(string) // e.g. aa
}

Example using .next()

var generator = new Seqstring();
console.log(generator.next());