Socket
Socket
Sign inDemoInstall

unique-names-generator

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unique-names-generator

Generate unique and memorable names


Version published
Weekly downloads
228K
decreased by-2.94%
Maintainers
1
Weekly downloads
 
Created

What is unique-names-generator?

The unique-names-generator npm package is a utility for generating random names. It can be used to create unique names for various purposes such as testing, creating unique identifiers, or generating placeholder names.

What are unique-names-generator's main functionalities?

Basic Name Generation

This feature allows you to generate a random name by combining words from different dictionaries. In this example, it combines an adjective, a color, and an animal to create a unique name.

const { uniqueNamesGenerator, adjectives, colors, animals } = require('unique-names-generator');
const randomName = uniqueNamesGenerator({ dictionaries: [adjectives, colors, animals] });
console.log(randomName);

Custom Dictionaries

You can use custom dictionaries to generate names. This example uses custom arrays of fruits and colors to create a unique name.

const { uniqueNamesGenerator } = require('unique-names-generator');
const customDictionaries = [['apple', 'banana', 'cherry'], ['red', 'green', 'blue']];
const randomName = uniqueNamesGenerator({ dictionaries: customDictionaries });
console.log(randomName);

Configurable Separators

This feature allows you to configure the separator used between words in the generated name. In this example, a hyphen is used as the separator.

const { uniqueNamesGenerator, adjectives, colors, animals } = require('unique-names-generator');
const randomName = uniqueNamesGenerator({ dictionaries: [adjectives, colors, animals], separator: '-' });
console.log(randomName);

Length Constraints

You can specify the number of words to be used in the generated name. This example generates a name with two words.

const { uniqueNamesGenerator, adjectives, colors, animals } = require('unique-names-generator');
const randomName = uniqueNamesGenerator({ dictionaries: [adjectives, colors, animals], length: 2 });
console.log(randomName);

Other packages similar to unique-names-generator

FAQs

Package last updated on 16 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc