npm.io
0.0.2-1 • Published 5 years ago

@gear4s/random-words

Licence
MIT
Version
0.0.2-1
Deps
0
Size
67 kB
Vulns
0
Weekly
0

Random Words!

Generate some random words, with a sane API

How do I use it?

To generate a random-ass, normal word, you can just import and call this function:

import GenerateRandomWord from "@gear4s/random-words";
const RandomWords = GenerateRandomWord();

You can also generate words that start with a letter:

import GenerateRandomWord from "@gear4s/random-words";

const startingLetter = "a";
const RandomWords = GenerateRandomWord(startingLetter);

Or generate words with a maximum length:

import GenerateRandomWord from "@gear4s/random-words";

const RandomWords = GenerateRandomWord(null, 6);

You can also generate more than one word at a time:

import GenerateRandomWord from "@gear4s/random-words";

const RandomWords = GenerateRandomWord(null, null, 15);

Argument list

  • letter
    • type: string
    • default: null
  • maxLength
    • type: number
    • min: 1
    • default: null
  • count
    • type: number
    • min: 1
    • default: null