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 🙏

© 2026 – Pkg Stats / Ryan Hefner

namecrafter

v1.2.1

Published

Generate random names - full names or individual first, middle, and last names

Readme

NameCrafter

A powerful and elegant Node.js package for generating authentic-sounding names. Create realistic first, middle, and last names individually or as full name combinations.

Installation

npm install namecrafter
# or
pnpm add namecrafter
# or
yarn add namecrafter

Usage

There are several ways to use NameCrafter, from simplest to most flexible:

1. Using Direct Function Imports (Simplest)

import { randomFirstName, randomMiddleName, randomLastName, randomName } from 'namecrafter';

// Get string values directly
const firstName = randomFirstName();    // e.g. "John"
const middleName = randomMiddleName();  // e.g. "Michael"
const lastName = randomLastName();      // e.g. "Smith"
const fullName = randomName();          // e.g. "John Michael Smith"

2. Using Static Methods

import { NameGenerator } from 'namecrafter';

// Use static methods directly from the class
const firstName = NameGenerator.randomFirstName();    // e.g. "John"
const middleName = NameGenerator.randomMiddleName();  // e.g. "Michael"
const lastName = NameGenerator.randomLastName();      // e.g. "Smith"

3. Using the Default Instance

import nameGenerator from 'namecrafter';

// Generate names using the default instance
const fullName = nameGenerator.randomName();
const firstName = nameGenerator.randomFirstName();
const middleName = nameGenerator.randomMiddleName();
const lastName = nameGenerator.randomLastName();

4. Creating Your Own Instance

import { NameGenerator } from 'namecrafter';

// Create a new instance
const generator = new NameGenerator();

// Generate names using your instance
const fullName = generator.randomName();
const firstName = generator.randomFirstName();
const middleName = generator.randomMiddleName();
const lastName = generator.randomLastName();

Features

  • ✨ Generate complete full names or individual name parts
  • 🎯 Direct access to string-returning functions
  • 🚀 Written in TypeScript with full type support
  • 📦 Zero dependencies
  • 📚 Large dataset of authentic names
  • 🌐 Works in both Node.js and browser environments
  • ⚡ Lightning fast and memory efficient
  • 🔒 Proper encapsulation with class-based architecture

API

Direct Functions

These are the simplest way to get string values:

randomFirstName()

Returns a random first name as a string.

const name = randomFirstName(); // e.g. "John"

randomMiddleName()

Returns a random middle name as a string.

const name = randomMiddleName(); // e.g. "Michael"

randomLastName()

Returns a random last name as a string.

const name = randomLastName(); // e.g. "Smith"

randomName()

Returns a complete random name as a string.

const name = randomName(); // e.g. "John Michael Smith"

Class: NameGenerator

The main class that provides name generation functionality.

Static Methods

  • NameGenerator.randomFirstName()
  • NameGenerator.randomMiddleName()
  • NameGenerator.randomLastName()

All static methods return strings and can be used without creating an instance.

Instance Methods

  • randomFirstName()
  • randomMiddleName()
  • randomLastName()
  • randomName()

All instance methods return strings and require an instance of the class.

License

MIT © James Johns