npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

just-random-names

v1.0.4

Published

A simple package to generate random names in multiple languages

Downloads

80

Readme

Random Name Generator

Random Name Generator is a simple and efficient package that generates multilingual pseudonyms by combining words from various categories like adjectives, nouns, tech terms, lifestyle, cars, food, sports, and travel. It supports multiple languages and allows configuration of the number of words in pseudonyms.

Features

  • Available Languages: English (en), French (fr), Spanish (es), Italian (it).
  • Dynamic Combinations: Combines words from multiple categories.
  • Customizable:
    • Specify the number of words (nbrWords)
    • Generate multiple names at once
    • Select specific word categories
  • Multilingual Usage: Easily switch between languages.

Installation

Add the package to your project using NPM or PNPM:

npm install just-random-names
pnpm install just-random-names

Usage

1. Generate a Random Name

Import the generateName function to create a random pseudonym:

import { generateName } from "just-random-names";

// Example: Generate a pseudonym in French with 3 words
const pseudo = generateName("fr", 3);
console.log(pseudo); // Example: "RapideDragonCodeur"

// Example: Generate a pseudonym using only lifestyle and travel categories
const specificPseudo = generateName("en", 2, [lifestyle, travel]);
console.log(specificPseudo); // Example: "NomadEpic"

2. Generate Multiple Names

Use generateMultipleNames to generate multiple pseudonyms at once:

import { generateMultipleNames } from "just-random-names";

// Example: Generate 5 pseudonyms in English with 2 words each
const pseudos = generateMultipleNames(5, "en", 2);
console.log(pseudos);
// Example: [ "FastPenguin", "BrightDragon", "IcyFalcon", "WeirdOtter", "AgileCoder" ]

// Example: Generate 3 pseudonyms using only tech and sports categories
const techSportsPseudos = generateMultipleNames(3, "en", 2, [sports]);
console.log(techSportsPseudos);
// Example: [ "CoderAgile", "DebuggerPrecise", "APICompetitive" ]

Parameters

generateName(lang: string = "en", nbrWords: number = 3, categories: Category[] = []): string

| Parameter | Type | Description | |--------------|------------|--------------------------------------------------------------------------------------------------| | lang | string | Language for the words: "en" (English), "fr" (French), "es" (Spanish), "it" (Italian). | | nbrWords | number | Number of words in the pseudonym. | | categories | Category[]| Optional array of categories to use. If empty, uses all categories. |

Returns: A string representing a unique pseudonym.

Available Categories

  • adjectives
  • nouns
  • techTerms
  • lifestyle
  • cars
  • food
  • sports
  • travel
  • animals
  • professions

generateMultipleNames(count: number = 10, lang: string = "en", nbrWords: number = 3, categories: Category[] = []): string[]

| Parameter | Type | Description | |--------------|------------|--------------------------------------------------------------------------------------------------| | count | number | Number of pseudonyms to generate. | | lang | string | Language for the words: "en" (English), "fr" (French), "es" (Spanish), "it" (Italian). | | nbrWords | number | Number of words in each pseudonym. | | categories | Category[]| Optional array of categories to use. If empty, uses all categories. |

Returns: An array containing multiple pseudonyms.


Advanced Examples

Random Generation with Default Language and Categories

const randomPseudo = generateName(); // Generates a pseudonym in English with 3 words from all categories
console.log(randomPseudo); // Example: "BrightOtterAlgorithm"

Generation in Spanish with Specific Categories

const pseudoEs = generateName("es", 3, ["lifestyle", "travel"]);
console.log(pseudoEs); // Example: "AventureroLejanoLibre"

License

This project is licensed under the MIT license.