JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 306290
  • Score
    100M100P100Q176740F
  • License MIT

Generate unique and memorable names

Package Exports

  • unique-names-generator

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (unique-names-generator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Unique Names Generator

More than 28,000,000 name combinations

NPM

Prerequisites

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

Table of contents

Installation

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

Usage

const { uniqueNamesGenerator } = require('unique-names-generator');

const randomName = uniqueNamesGenerator(); // big_red_donkey

const shortName = uniqueNamesGenerator('-', true); // big-donkey

Typescript support

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

API

uniqueNamesGenerator(separator?: string, short?: boolean)

Returns a string with a random generated name

separator

Type: string Default: _

A string separator to be used for separate the words generated. The default separator is set to _.

short

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.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Add your changes: git add .
  4. Commit your changes: git commit -am 'Add some feature'
  5. Push to the branch: git push origin my-new-feature
  6. Submit a pull request 😎

License

MIT License © Andrea SonnY