Socket
Socket
Sign inDemoInstall

@proto.email/random-words

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @proto.email/random-words

Minified version | Generate one or more common English words


Version published
Weekly downloads
3
Maintainers
1
Created
Weekly downloads
 

Readme

Source

random-words

This is minified version of @random-words by Thomas Boutell

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 @proto.email/random-words

Examples:

var randomWords = require('@proto.email/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'

console.log(randomWords({ exactly: 5, join: '' }))
    'armybeautifulbecameifexactly'

console.log(randomWords({exactly: 5, maxLength: 4}))
['army','come','eye','five','fur']

console.log(randomWords({exactly:5, wordsPerString:2}))
[ 'salt practical', 'also brief', 'country muscle', 'neighborhood beyond', 'grew pig' ]

console.log(randomWords({exactly:5, wordsPerString:2, separator:'-'}))
[ 'equator-variety', 'salt-usually', 'importance-becoming', 'stream-several', 'goes-fight' ]

console.log(randomWords({exactly:5, wordsPerString:2, formatter: (word)=> word.toUpperCase()}))
[ 'HAVING LOAD', 'LOST PINE', 'GAME SLOPE', 'SECRET GIANT', 'INDEED LOCATION' ]

console.log(randomWords({exactly:5, wordsPerString:2, formatter: (word, index)=> {
    return index === 0 ? word.slice(0,1).toUpperCase().concat(word.slice(1)) : word;
}}))
[ 'Until smoke', 'Year strength', 'Pay knew', 'Fallen must', 'Chief arrow' ]

Keywords

FAQs

Last updated on 11 May 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc