Petname implementation in JavaScript, inspired by Dustin Kirkland's Petname. The data is from petname.
node
>= v12npm
>= v5
javascript-petname
can either be installed globally or used with npx
.
npm install -g javascript-petname
npx javascript-petname
npx javascript-petname <args>
The following arguments are available
argument | description |
---|---|
--words , -w |
number of words, defaults to 2 . |
--separator , -s |
separator, defaults to - |
All arguments is available in the exported generatePetname()
function.
npx javascript-petname
npx javascript-petname -w 4 -s =
const { generatePetname } = require('javascript-petname');
generatePetname();
const { generatePetname } = require('javascript-petname');
generatePetname({
words: 4,
separator: '=',
});
If you want to contribute and make our project better, your help is very welcome.