Giter Club home page Giter Club logo

hua's Introduction

Huaming

🌺 Make yourself easy to pick an alibaba flavor name (aka. 花名).

For my friend HiccupLong to join Mogujie.

Installation

$ [sudo] npm install -d -g huaming

Or if you prefer to use it as a library.

$ npm install -d --save huaming

CLI

If you installed it as a CLI in global, you may use it like this:

$ hua --help

Usage: hua [options]

Options:
-p PREFIX, --prefix PREFIX          to specify a prefix.
-s SUFFIX, --suffix SUFFIX          to specify a suffix.
-5 WUXING, --five-elements WUXING   the file elements (Wuxing) of huaming.
-c COUNT, --count COUNT             the count of huaming  [10]
-i SOURCE, --source SOURCE          the source of huaming, you can choose `dict` or `tangshi`. If you choose `tangshi`, only `count` will effected  [dict]

Example

$ hua

 * 彤摸
 * 豫墀
 * 趣工
 * 倚赚
 * 愁监
 * 竿铁
 * 错页
 * 洪讲
 * 顶馥
 * 右虹
 
$ hua --prefix 龙

 * 龙幼
 * 龙巡
 * 龙躬
 * 龙仇
 * 龙锤
 * 龙镒
 * 龙拾
 * 龙央
 * 龙些
 * 龙悠

$ hua --five-elements 金水

 * 倩娥
 * 雀效
 * 黍棓
 * 姹溶
 * 馨沙
 * 宫闲
 * 裕混
 * 俗封
 * 绸娥
 * 瑞淦

$ hua -i tangshi

 * 总是 -- 李白 《子夜四时歌[秋歌]》
 * 夜送 -- 白居易 《琵琶行并序》
 * 光集 -- 马戴 《楚江怀古》
 * 今成 -- 李白 《长相思二首之二》
 * 畏蒺 -- 王维 《老将行》
 * 客愁 -- 孟浩然 《宿建德江》
 * 盈尺 -- 李白 《蜀道难》
 * 一树 -- 李商隐 《蝉》
 * 方悟 -- 王维 《西施咏》
 * 方来 -- 韦应物 《长安遇冯著》

Library

If you want use huaming as an library, you may read this document.

Hua

const Hua = require("huaming");
const huaming = new Hua(options);

options is an object that same as CLI mode.

  • options.prefix
  • options.suffix
  • options["five-elements"]
  • options.count

generateOne

let result = huaming.generateOne();

// returns only one random huaming.

generate

let results = huaming.generate();

// returns `options.count` random huaming(s).

HuaTangshi

const Hua = require("huaming");
const huaming = new Hua.Tangshi(options);

options is an object that same as CLI mode.

  • options.count

init

huaming.init(function(err) {
    // do something...
});

generateOne

huaming.generateOne(function(err, hua, meta) {
    // do something...
});

Note: You must call init function before using this function.

generate

huaming.generate(function(err, names) {
    // names -> [
    //     { name: huaming1, meta: {} }
    //     { name: huaming2, meta: {} }
    // ]
});

Note: You must call init function before using this function.

Contribution

You're welcome to make pull requests!

「雖然我覺得不怎麼可能有人會關注我」

hua's People

Contributors

xadillax avatar lisposter avatar lfeng avatar

Watchers

James Cloos avatar hongyu 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.