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

mingzi-ts

v1.0.1

Published

Random Chinese name generator — CLI and API

Downloads

279

Readme

mingzi-ts 名字

Random Chinese name generator — CLI and API

Generate realistic Chinese names using a statistically accurate database of 1,806 surnames and 2,614 given-name characters sourced from 1.2 billion Han Chinese records (1930–2008).

Installation

# CLI
npm install -g mingzi-ts

# API
npm install mingzi-ts

CLI Usage

mingzi                            # random name
mingzi --count 5                  # 5 random names
mingzi --gender female            # female name
mingzi --gender male --count 3    # 3 male names
mingzi --compound                 # allow compound surnames (e.g. 欧阳)
mingzi --given-length 1           # single character given name
mingzi --given-length 2           # two character given name
mingzi --no-weight                # disable frequency-weighted picking
mingzi --min-valence 4            # only positive-meaning characters
mingzi --min-warmth 4             # only warm/moral characters
mingzi --min-competence 4         # only competence-associated characters
mingzi --version                  # show version
mingzi --help                     # show help

Example Output

王芳  (王 + 芳)  [female]
李伟明  (李 + 伟明)  [male]
欧阳晨  (欧阳 + 晨)  [neutral]

API Usage

import { generate, generateMany } from "mingzi-ts";

// Single name (neutral gender, defaults)
const name = generate();
console.log(name.full);    // e.g. 王芳
console.log(name.surname); // 王
console.log(name.given);   // 芳
console.log(name.gender);  // "female" | "male" | "neutral"

// With options
const name = generate({
  gender: "male",
  givenLength: 2,
  allowCompound: false,
  weighted: true,
});

// Multiple names
const names = generateMany(5, { gender: "female" });

// Quality filters (returns metadata when used)
const name = generate({ minValence: 4, minWarmth: 4 });
console.log(name.valence);    // e.g. 4.44
console.log(name.warmth);     // e.g. 4.30
console.log(name.competence); // e.g. 3.50

Options

| Option | Type | Default | Description | |---|---|---|---| | gender | "male" \| "female" \| "neutral" | "neutral" | Gender affinity of given name characters | | allowCompound | boolean | false | Allow compound surnames like 欧阳, 司马 | | givenLength | 1 \| 2 \| "random" | "random" | Number of characters in given name | | weighted | boolean | true | Weight picks by real-world frequency | | minValence | number (1–5) | — | Minimum meaning positivity score | | minWarmth | number (1–5) | — | Minimum warmth/morality score | | minCompetence | number (1–5) | — | Minimum competence score |

Data

Name data is sourced from the ChineseNames R package (CC BY-NC-SA), originally from China's National Citizen Identity Information Center (2008). Covers ~1.2 billion Han Chinese born 1930–2008.

License

MIT © Yonasoft