monkey-typewriter v1.0.14
monkey-typewriter
Randomly generated words and slugs that look and sound like english words.
Infinite monkey theorem
The infinite monkey theorem states that a monkey hitting keys at random on a typewriter keyboard for an infinite amount of time will almost surely type any given text, such as the complete works of William Shakespeare.
Demo
Check out the live backend express example deployed on cyclic >> DEMO
The Monkey
Using some basic rules and probabilities in english vocabulary allows the Monkey to be really small!
A unique and readable word accommodates most use-cases like id and slug generation. These often rely on much larger and sometimes unnecessary packages.
- monkey-typewriter:
5.22 kB - random-word-slugs:
186.22 kB - faker:
10.1 MBthats over 2000 times bigger!
The Monkey comes up with words that look and sound like english words:
telebo
kuokesque
taity
nonfees
intave
exlission
unnoful
dengothalInstallation
npm i monkey-typewriterInclude as:
const Monkey = require('monkey-typewriter')or
import * as Monkey from 'monkey-typewriter'Usage
The Monkey has two methods right now, word and slug. Both produce unique strings from millions of possible combinations for a low collision probability.
word()- generates an english sounding wordslug(num)- generates kabob-slugs of lengthnum
console.log(Monkey.word())
// > telepopconsole.log(Monkey.slug())
// > chush
console.log(Monkey.slug(2))
// > memion-exlifacy
console.log(Monkey.slug(3))
// > confuedible-chored-repupContributing:
This package is written vanilla javascript and has no dependencies. We suggest to keep the complexity low to eliminate possible security issues