Socket
Socket
Sign inDemoInstall

generate-random-username

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generate-random-username

A tiny module to generate a random username from a list of adjectives and animals.


Version published
Weekly downloads
69
increased by30.19%
Maintainers
0
Weekly downloads
 
Created
Source

generate-random-username

A tiny package to generate a random username from a list of adjectives and animals.

This package will generate close to 200k different unique usernames, even more with digits appended. The wordlist has been manually reviewed to ensure the words are appropriate for use in a username.

Options exist for a custom separator between the username, limiting username to a maximum length, adding random digits, and capitalizing the words in the username.

Install

npm install generate-random-username

Usage

import generateRandomUsername from 'generate-random-username';

generateRandomUsername();
//=> 'humble-shrew'

generateRandomUsername({ capitalize: true });
//=> 'Witty-Camel'

generateRandomUsername({ separator: '_' });
//=> 'safe_llama'

generateRandomUsername({ maxLength: 10 });
//=> 'clear-eel'

generateRandomUsername({ digits: 3, capitalize: true });
//=> 'Unaffected-Cat-184'

API

generateRandomUsername(options?)

options

Type: object

capitalize

Type: boolean
Default: false

Whether to capitalize each word used in the username.

separator

Type: string
Default: '-'

Separator to use between words in the username.

digits

Type: number
Default: 0

Number of random digits to append to end of username.

maxLength

Type: number
Default: null

The maximum length of a username to generate. For lengths under 10, it may not always find a username under that length, and will fallback to returning a longer username.

Keywords

FAQs

Package last updated on 10 Sep 2024

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