More than 28,000,000 name combinations
This project requires NodeJS (at least version 6) and NPM. Node and NPM are really easy to install. To make sure you have them available on your machine, try running the following command.
$ node --version
v7.10.1
$ npm --version
4.2.0
BEFORE YOU INSTALL: please read the prerequisites
Install the package using npm or Yarn
$ npm i -S unique-names-generator
Or using Yarn
$ yarn add unique-names-generator
const { uniqueNamesGenerator } = require('unique-names-generator');
const randomName = uniqueNamesGenerator(); // big_red_donkey
const shortName = uniqueNamesGenerator('-', true); // big-donkey
This package export a type definition file so you can use it out of the box inside your typescript project.
import { uniqueNamesGenerator } from 'unique-names-generator';
const randomName: string = uniqueNamesGenerator(); // big_red_donkey
const shortName: string = uniqueNamesGenerator('-', true); // big-donkey
Returns a string
with a random generated name
Type: string
Default: _
A string separator to be used for separate the words generated.
The default separator is set to _
.
Type: boolean
Default: false
If set, it will return a random word composed by 2 words. The default value is set tu true and it will return a name composed by 3 words.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Add your changes:
git add .
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request 😎
MIT License © Andrea SonnY