Configurable Username Generator
Go to file
Nicco 00d835f4fc
Merge pull request #17 from cupcakearmy/dependabot/npm_and_yarn/vite-5.0.13
Bump vite from 5.0.12 to 5.0.13
2024-04-05 09:38:33 +02:00
.github logo 2021-03-15 18:31:28 +01:00
demo move to vite 2023-07-12 23:05:30 +02:00
generate update wordlist 2023-07-12 22:47:42 +02:00
src update wordlist 2023-07-12 22:47:42 +02:00
.gitignore move to vite 2023-07-12 23:05:30 +02:00
.gitmodules added submodule 2020-02-15 17:14:35 +01:00
LICENSE cleanup & updates 2021-03-15 18:14:19 +01:00
README.md Update README.md 2023-11-21 10:50:42 +01:00
package.json version bump 2023-11-21 10:54:29 +01:00
pnpm-lock.yaml Bump vite from 5.0.12 to 5.0.13 2024-04-03 18:27:41 +00:00
tsconfig.json update deps 2023-07-12 22:37:34 +02:00

README.md

logo

version badge downloads badge dependency count minzip size badge types badge

Username generator. Fully typed, simple and customizable. 0 Dependencies

The lists are taken from this repo and automatically converted into json by ./generate/wordlist.js

🕹 Interactive Demo

Small website where you can see it in action and customize the output.

https://canihazusername.vercel.app/

🏗 Install

npm i canihazusername

yarn add canihazusername

pnpm i canihazusername

🚀 Quickstart

import { generate } from 'canihazusername'

const username = generate()

🎛 Customize

You can of course customize the generated username. The default format string is {character}_{english}.

import { generate } from 'canihazusername'

const username = generate('something-{character}_bot')

Basically you can use any string you want and everything between {somelist} will be replaced from a random word from the list called somelist.

There is a list of available words that you can use.

⛓ Combine multiple lists

You can also combine multiple (as many as you wish) lists into the same braket with the | charcter. This will build a combined list and choose at random between all those words.

import { generate } from 'canihazusername'

const username = generate('{quantity|age|cats|}')

This example will choose a random word between the quantity, age and cats list.

✒️ Use you own lists

You can also add your own lists or owerwrite the built in one.

import { generate } from 'canihazusername'

const gits = ['gitlab', 'github', 'gitea']
const username = generate('{gits}', { lists: { gits } })

🔐 Reformats limit

For security reasons the default limit for the maximum reformats/insertions is set to 16.

If you use more than 16 {} you can increase them with the maxReformats option.

import { generate } from 'canihazusername'

const username = generate('{1} {2} ... {17}', { maxReformats: 16 }) // ❌ The last one will not be replaced
const username = generate('{1} {2} ... {17}', { maxReformats: 20 }) // ✅

🗂 Lists

  • age
  • algorithms
  • appearance
  • character
  • colors
  • complexity
  • construction
  • corporate_prefixes
  • emotions
  • food
  • geometry
  • linguistics
  • materials
  • music_theory
  • physics
  • quantity
  • shape
  • size
  • sound
  • speed
  • taste
  • temperature
  • weather
  • corporate
  • crypto
  • hipster
  • lorem
  • reddit
  • alpha
  • canada
  • city_states
  • france
  • ireland
  • netherlands
  • spain
  • switzerland
  • united_states
  • apple
  • intel
  • microsoft
  • unicorns
  • butlers
  • computing
  • founders
  • fictional
  • usa
  • chicago
  • newyork
  • basque
  • english
  • french
  • german
  • irish
  • italian
  • scottish
  • 3d_graphics
  • 3d_printing
  • accounting
  • apex_predators
  • architecture
  • astronomy
  • automobiles
  • birds
  • buildings
  • car_parts
  • cats
  • cheese
  • chemistry
  • coding
  • condiments
  • containers
  • corporate_job
  • cotton
  • data_structures
  • design
  • dogs
  • driving
  • fast_food
  • filmmaking
  • fish
  • fortifications
  • fruit
  • furniture
  • gaming
  • geography
  • ghosts
  • history
  • houses
  • infrastructure
  • insurance
  • linear_algebra
  • machine_learning
  • meat
  • metals
  • military_airforce
  • military_army
  • military_navy
  • minerals
  • monkeys
  • music_instruments
  • music_production
  • phones
  • physics_optics
  • physics_units
  • physics_waves
  • plants
  • radio
  • real_estate
  • screenwriting
  • seasonings
  • set_theory
  • shopping
  • snakes
  • software
  • spirits
  • sports
  • startups
  • storage
  • travel
  • typography
  • vcs
  • water
  • web_development
  • wine
  • wood
  • writing
  • art
  • collection
  • communication
  • cooking
  • creation
  • destruction
  • fire
  • graphics
  • look
  • manipulation
  • movement
  • music
  • programming
  • thought
  • web

🙏 Credits