1.0.0 • Published 7 years ago

rwg v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

rwg

Random Word Generator

Dependencies

  • Node.js (Tested with 8.3.0+)

Usage

NOTE:

In the project's current state, the way words are loaded can cause a race condition. There is an exposed isReady() method which returns a boolean stating if the object is loaded or not. In a future version I might expose an onReady() method or some sort of ready callback.

const RWG = require('rwg');

// Constructor with no limit on words
const rwg1 = new RWG();

rwg1.getRandomWord();

// Constructor with min/max constraints
const rwg2 = new RWG({ min: 3, max: 10 });

rwg2.getRandomWord();

Constructor Options:

  • min (Integer): Minimum word length
  • max (Integer): Maxmimum word length