Skip to content

jacksonrayhamilton/scrab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scrab

A random word and sentence generation utility.

Usage:

npm install --save scrab
var scrab = require('scrab');

console.log('My favorite word of all time is "' + scrab.word() + '".');
// => My favorite word of all time is "interpretation".

scrab.word({
    preposition: true
});
// => "off"
// => "down"

scrab.word({
    conjunction: true
});
// => "so"
// => "and"

// Capitalize the first letter of random words.
scrab.word({
    capitalize: true
});
// => "Contact"

// Get a bunch of random words.
scrab.words();
// => ["secret", "senility", "bedside", "corrupting", "was", "indicates"]

// Get totally random sentences.
scrab.sentence();
// => "Significance including budget; creates because where?"
// => "Bed perform justify emergency!""
// => "Lay: his; matter after while until.""

// Get sentences with specific criteria.
scrab.sentence({
    min: 2,
    max: 3,
    capitalize: true,
    punctuate: false
});
// => "Incline Supposedly Books"

// SCREAM!!!
scrab.sentence({
    scream: true
});
// => GRANTED DRUNKS; THEMSELVES DISCUSSES!!!
// => REPRODUCE LIMITED PROGRESSIVE SAVES, CONCRETE DOPING!!!

About

A random word and sentence generation library.

Resources

License

Stars

Watchers

Forks

Packages

No packages published