bifot / random-words

Generate one or more common English words. Intended for use as sample text, for example generating random blog posts for testing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

random-words

Generate one or more common English words

random-words generates random words for use as sample text. We use it to generate random blog posts when testing Apostrophe.

Cryptographic-quality randomness is NOT the goal, as speed matters for generating sample text and security does not. Math.random() is used.

Installation:

$ npm install random-words

Examples:

const randomWords = require('random-words')

console.log(randomWords()) // => 'army'
console.log(randomWords(5)) // => ['army', 'beautiful', 'became', 'if', 'actually']
console.log(randomWords({ min: 3, max: 10 })) // => ['became', 'arrow', 'article', 'therefore']
console.log(randomWords({ exactly: 2 })) // => ['beside', 'between']
console.log(randomWords({ exactly: 5, join: ' ' })) // => 'army beautiful became if exactly'

License

MIT.

About

Generate one or more common English words. Intended for use as sample text, for example generating random blog posts for testing

License:MIT License


Languages

Language:JavaScript 100.0%