Giter Club home page Giter Club logo

chinese-random-name's Introduction

Chinese Random Name

Generate Chinese name using Node.js.

Installation

$ npm install chinese-random-name

Usage

Generate a Full Name Automatically

Using generate function:

var randomName = require("chinese-random-name");

console.log(randomName.generate());

Only Surname

Using getOne function in surnames.

console.log(randomName.surnames.getOne());

Name

Using get / get1 / get2 / get3 function in names.

  • get: returns a random name and its length between 1 and 3.
  • get1: returns a random name with length 1. (you can pass a parameter which may be "金" / "木" / "水" / "火" / "土" or leave it blank)
  • get2: returns a random name with length 2. (you can pass "金金" / "金木" / ... or leave it blank)
  • get3: returns a random name with length 3. (you can pass "金金金" / "水火土" / ... or leave it blank)

Examples:

randomName.names.get();
randomName.names.get1();
randomName.names.get2();
randomName.names.get3();
randomName.names.get1("金");
randomName.names.get2("木水");
randomName.names.get3("火火火");

Related Article

http://xcoder.in/2014/09/01/how-i-made-chinese-random-x/

Contribute

You're welcome to fork and push requests!

chinese-random-name's People

Contributors

xadillax avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.