/fakelish-npm

Fake English word generator for JavaScript/TypeScript

Primary LanguageTypeScriptMIT LicenseMIT

fakelish

npm Build Status

Fake English word generator

Try on Web Browser

https://fakelish.nwtgck.org
(repo: https://github.com/nwtgck/fakelish-web)

Install

npm i -S fakelish

Usage

Here is an usage in JavaScript.

// Import fakelish
const fakelish = require("fakelish");

// Min and max Lengths of fake words
const minLen = 7;
const maxLen = 11;

(async ()=>{
  // Generate 20 fake words
  for(let i = 0; i < 20; i++) {
    // Generate a fake word
    const fakeWord = await fakelish.generateFakeWord(minLen, maxLen);
    // Print the capitalized fake word
    console.log(capitalize(fakeWord));
  }
})();

// Capitalize string
function capitalize(str) {
  return str.charAt(0).toUpperCase() + str.substring(1);
}

(example/src/example1.js)

The output should be like the following.

Schyperant
Imposillack
Tioughters
Schgruids
Viestios
Mundrial
Unkalphast
Mireock
Babrilly
Formalated
Gimbrawer
Trident
Compler
Ligical
Deprene
Ocoarriete
Raxalluffic
Pecties
Daeorhons
Herbalve

For Go language and CLI

GitHub Repository: https://github.com/nwtgck/go-fakelish