faker-hk
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

Faker HK

Faker HK is a tool to generate fake Hongkongers' profile in ethnic Chinese. The package draws over 2 million naming combinations with proper Cantonese Romanisation. The package is based on Cantonese Romanisation and hkid.

Demo is available here.

Install

npm install faker-hk

or

yarn add faker-hk

Usage

new Person(seed?: number)

import Person from "faker-hk";
// @return: a random person profile
console.log(new Person())

// @return a profile with seed specified
console.log(JSON.stringify(new Person(19911202)))
/*
{
    "sex": "m",
    "chnFirstname": "潤成",
    "hkid": "XA2021193",
    "chnSurname": "黃",
    "firstname": "Yun Shing",
    "surname": "Wong",
    "avatar": "https://avatars.githubusercontent.com/u/19911202",
    "birth": "1942-01-06T16:20:07.197Z",
    "phone": "69911201",
    "address": "45 TUEN LUNG STREET, TUEN MUN DISTRICT",
    "chnAddress": "屯門區屯隆街45號"
}
*/

Dictionary

If you would like to update the dictionary, you may checkout ./dictionary/*.json in the repository.

Contribute

Project owner chunlaw is the initiator of the whole project. Everyone is welcome to contribute.

License

MIT license

Package Sidebar

Install

npm i faker-hk

Weekly Downloads

1

Version

1.0.6

License

MIT

Unpacked Size

1.73 MB

Total Files

43

Last publish

Collaborators

  • chunlaw