2.0.2 • Published 1 year ago

random-username-gen v2.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Random Username Generator

A random username generator with customization options. Generate unique and complex usernames based on user input, different word lists, and custom separators.

Installation

Install the package using npm:

npm install random-username-gen

Usage

Using import (ECMAScript modules)

import generateRandomUsername from 'random-username-gen';

const userInput = 'user';
const options = {
  length: 12,
  separator: '-',
  wordList: 'default', // You can add and use custom word lists
  ensureUnique: false,
};

const username = generateRandomUsername(userInput, options);
console.log(username);

Using require (CommonJS modules)

const generateRandomUsername = require('random-username-gen');

const userInput = 'user';
const options = {
  length: 12,
  separator: '-',
  wordList: 'default', // You can add and use custom word lists
  ensureUnique: false,
};

const username = generateRandomUsername(userInput, options);
console.log(username);

Options

  • length (default: 12): The desired length of the generated username. The final username might be shorter if the user input, word list, or separator result in a longer string.
  • separator (default: '-'): The character used to separate the different parts of the username.
  • wordList (default: 'default'): The word list to use for generating the username. You can add custom word lists to the index.js file.
  • ensureUnique (default: false): If set to true, a unique suffix will be added to the username to ensure uniqueness.

License

This project is licensed under the MIT License.

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago