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

gender-name

v1.1.0

Published

A TypeScript library for detecting a first name's likely gender and language origin, with support for common nicknames and abbreviations. Also supports inverse lookup: get a random name for a given gender and language.

Readme

gender-name

A TypeScript library for detecting a first name's likely gender and language origin, with support for common nicknames and abbreviations. Also supports inverse lookup: get a random name for a given gender and language.

Languages

en · es · fr · de · it · zh · ja

Installation

bun add gender-name

Usage

determineNameInfo(name)

Returns the gender and language for a given name, or null if the name is not in the database.

import { determineNameInfo } from 'gender-name';

determineNameInfo('Juan');  // { name: 'Juan',  gender: 'male',   language: 'es' }
determineNameInfo('Mary');  // { name: 'Mary',  gender: 'female', language: 'en' }
determineNameInfo('Yuki');  // { name: 'Yuki',  gender: 'female', language: 'ja' }
determineNameInfo('Matt');  // { name: 'Matt',  gender: 'male',   language: 'en' }
determineNameInfo('Bob');   // { name: 'Bob',   gender: 'male',   language: 'en' }
determineNameInfo('Xyz');   // null

Input is case-insensitive and whitespace-trimmed.

When a name exists in multiple languages, origin is resolved by priority: es > it > fr > de > zh > ja > en.

getNameByGender(gender?, language?)

Returns a random name for the given gender and language. Both arguments are optional.

import { getNameByGender } from 'gender-name';

getNameByGender('female', 'es');  // e.g. 'Carmen'
getNameByGender('male', 'ja');    // e.g. 'Haruki'
getNameByGender('male');          // random English male name
getNameByGender('female', null);  // random English female name
getNameByGender();                // random English name, gender chosen at random
  • If language is falsy, defaults to 'en'
  • If gender is falsy, a gender is chosen at random

Returns null if no names are found for the given combination.

Types

type Gender   = 'male' | 'female';
type Language = 'en' | 'es' | 'fr' | 'de' | 'it' | 'zh' | 'ja';

interface NameInfo {
  name: string;      // capitalized
  gender: Gender;
  language: Language;
}

Database

~720 entries covering full names and common nicknames/abbreviations:

| Language | Examples (full names) | Examples (nicknames) | |----------|-----------------------|----------------------| | en | James, Mary, Elizabeth | Bob, Matt, Liz, Becky | | es | Juan, Carmen, Santiago | Paco, Lola, Nacho | | fr | Pierre, Marie, Camille | — | | de | Hans, Hildegard, Lukas | — | | it | Giancarlo, Giulia, Marco | Beppe, Gia, Sandro | | zh | Wei, Mei, Haoran | — | | ja | Hiroshi, Sakura, Kaito | — |

Development

bun test      # run tests
bun run build # compile to dist/

License

MIT