Generate unique animal IDs for your projects
npm install randimals
> Generate adorable and unique animal IDs for your projects.
Start by installing the package locally into your project:
``bash`
$ npm install randimalsor
$ yarn add randimals
`js
const randimals = require('randimals');
// Default arguments generate an animal with one adjective
console.log(randimals());
// => "Astronomical Wallaby"
// Using a number as an argument specifies the amount of adjectives
console.log(randimals(3));
// => "Wearable Ceramic Responsible Grizzlybear"
// Using a string as an argument specifies the naming convention
console.log(randimals('snake'));
// => "depressed_alligator"
// Combine and mess around with different options!
console.log(randimals({
adjectives: 2,
animals: 2,
case: 'upper',
separator: '.'
}));
// "DESIROUS.UNINSPIRED.COW.GRUB"
`
If you install the package globally, you can use the command line tool:
`bash`
$ npm install -g randimalsor
$ yarn global add randimals
`shelldefault with no arguments
$ randimals
Bouncy Goose
$3
`shell
$ randimals -h Usage: randimals [options]
Options:
-V, --version output the version number
-a, --adjectives set the number of adjectives to output (default: "1")
-n, --animals set the number of animals to output (default: "1")
-f, --format set the naming convention for each word (ex: 'pascal', 'snake', 'capital', etc.) (default: "capital")
-c, --case set the case for each word (ex: 'lower', 'upper', 'capital')
-s, --separator set the separator string between each adjective and noun
-h, --help display help for command
``A simple package that I made to emulate the random string generation that Twitch and GfyCat use for their sites. I wanted to use the strings as unique IDs in another project of mine so I decided to try writing a package myself. In the process, I learned a lot more about the TypeScript, Gulp, Browserify, and module ecosystem 😓
Big thank you to GfyCat for the adjective and animal lists. Logo image is taken from OpenMoji 13.0
Under the MIT License