JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 109858
  • Score
    100M100P100Q157848F
  • License MIT

Generate one or more common English words

Package Exports

  • random-words

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (random-words) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.

Examples:

var 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'