Skip to content

Fake English word generator for JavaScript/TypeScript

License

Notifications You must be signed in to change notification settings

nwtgck/fakelish-npm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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