1.0.8 • Published 5 years ago

seqgen v1.0.8

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

SeqGen

Travis (.com) npm npm

A basic number sequence generator, verifier and formatter in TypeScript. Documentation is here, and usage examples are below.

Usage

SeqGen may be used like this in JavaScript:

const seqgen = require('seqgen')

const mySeq = new seqgen.Sequence(2, 20, 10)
console.log('My sequence:', mySeq.format())
// > My sequence: 2, 4, 6, 8, 10, 12, 14, 16, 18, 20

Or, with a change to the only the import, in TypeScript:

import * as seqgen from 'seqgen'

const mySeq = new seqgen.Sequence(2, 2, 10)
console.log('My sequence:', mySeq.format())
// > My sequence: 2, 4, 6, 8, 10, 12, 14, 16, 18, 20

The verify function works like this:

const seqgen = require('seqgen')

const mySeq = new seqgen.Sequence(2, 20, 10)
console.log(mySeq.verify([2, 4, 6, 8, 10, 12, 14, 16, 18, 20]))
// > true
console.log(mySeq.verify([2, 5, 6, 8, 10, 12, 14, 16, 18, 20]))
// > false

Building

Building SeqGen requires TypeScript 3.x.

To build SeqGen, first clone the GitHub repository:

git clone https://github.com/rocketicv/seqgen.git

Then, fetch dependencies:

npm install --dev

And finally, run:

npm run build

Testing

SeqGen supports unit tests using mocha and chai.

To run the tests, clone the repo and run:

npm install --dev

Followed by:

npm run test

Documentation

Documentation is hosted here on Github Pages, and in the docs/ folder.

To generate documentation for SeqGen using TypeDoc, clone the repo, install dev dependencies, and run:

npm run genDocs

1.0.8

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago