javascript-petname

JavaScript Petname

Usage no npm install needed!

<script type="module">
  import javascriptPetname from 'https://cdn.skypack.dev/javascript-petname';
</script>

README

javascript-petname

Petname implementation in JavaScript, inspired by Dustin Kirkland's Petname. The data is from petname.

latest git version latest npm version license

Installation

Requirements

  • node >= v12
  • npm >= v5

javascript-petname can either be installed globally or used with npx.

npm install -g javascript-petname
npx javascript-petname

Usage

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.

Example

npx javascript-petname
npx javascript-petname -w 4 -s =
const { generatePetname } = require('javascript-petname');

generatePetname();
const { generatePetname } = require('javascript-petname');

generatePetname({
  words: 4,
  separator: '=',
});

Contributing

If you want to contribute and make our project better, your help is very welcome.

License

MIT © anthonkendel