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

chn-random-name

v0.0.10

Published

```bash npm install chn-random-name ```

Downloads

8

Readme

Install

npm install chn-random-name

Basic Usage

import { Name } from 'chn-random-name'
let name = new Name().Name
console.log(name) // 张家都

Advanced Usage

import { Name } from 'chn-random-name'
let nameList = Array(10).fill('').map(item => {new Name({
  Gender: 'Female', // target gender of random name
  Type: 'ENG' // target name source
}).Name})
console.log(name)
/** 
 * [
 '安娜·杰克逊',
 '贝利·戈麦斯',
 '玛格丽特·马丁内斯',
 '海莉·汤普森',
 '赖莉·威尔逊',
 '玛丽亚·希门尼斯',
 '阿什莉·克拉克',
 '凯莉·贝尔',
 '索菲亚·森',
 '佐伊·森'
 ]
 * **/

All Name Configs

type NameProps = {
  Gender?: 'Male' | 'Female' // assign gender of target name; default: random
  Target?: 'CHN' | 'ENG' // target language of .Name attribute; default: CHN
  Type?: 'CHN' | 'ENG' | 'JPN' // assign type of name; default: CHN
  NameOrder?: 'FMG' | 'GMF' // overwrite name order; Family Name in front or Given Name in fron
  NameOrderSplit?: string // Spliter between Family Name and GivenName
  Normalize?: boolean // if keep variant of English Character
  // below support FamilyName,GivenName,MiddleName,NameOrder & NameOrderSplit
  English?: NameTypeConstructor // overWrite Name setting of target ENG return
  Chinese?: NameTypeConstructor // overWrite Name setting of target CHN return
}

Example

let nameList = Array(10).fill('').map(item => {
  const tempName = new Name({
    Gender: 'Male',
    Type: 'CHN',
    Target: 'ENG',
    Chinese: {
      FamilyName: '张'
    },
    English: {
      NameOrderSplit: '-',
      FamilyName: 'Zhang',
    }
  })
  let returnValue = [tempName.Name]
  // Can overWrite some attribute of language
  if (tempName.English) {
    tempName.English.Normalize = true
  }
  returnValue.push(tempName.Name)
  // Can change target language after spawn
  tempName.Target = 'CHN'
  returnValue.push(tempName.Name)
  return returnValue
})
console.log(nameList)
/*
*   [
      [ 'Jūnbó-Zhang', 'Junbo-Zhang', '张钧博' ],
      [ 'Hé-Zhang', 'He-Zhang', '张和' ],
      [ 'Hǎiwàng-Zhang', 'Haiwang-Zhang', '张海旺' ],
      [ 'Qìngjìng-Zhang', 'Qingjing-Zhang', '张庆靖' ],
      [ 'Guāntíng-Zhang', 'Guanting-Zhang', '张冠廷' ],
      [ 'Shàoxiáng-Zhang', 'Shaoxiang-Zhang', '张绍祥' ],
      [ 'Yǒngxiū-Zhang', 'Yongxiu-Zhang', '张永修' ],
      [ 'Qīngbō-Zhang', 'Qingbo-Zhang', '张清波' ],
      [ 'Pénghuī-Zhang', 'Penghui-Zhang', '张鹏晖' ],
      [ 'Shūhuái-Zhang', 'Shuhuai-Zhang', '张书怀' ]
    ]
*  */

Credit (Data Sources)

Chinese Names

https://zh.wikipedia.org/wiki/%E4%B8%AD%E5%9B%BD%E5%A7%93%E6%B0%8F%E6%8E%92%E5%90%8D https://github.com/wainshine/Chinese-Names-Corpus

English Names

https://web.archive.org/web/20081209221654if_/http://www.census.gov:80/genealogy/www/Top1000.xls https://www.ssa.gov/cgi-bin/popularnames.cgi

Japanese Names

https://myoji-yurai.net/prefectureRanking.htm?prefecture=%E5%85%A8%E5%9B%BD&page=0 https://github.com/willnet/gimei