GitXplorerGitXplorer
p

node-pinyin-string

public
7 stars
1 forks
0 issues

Commits

List of commits on branch master.
Unverified
987f630b50ad3fcec573dddb536bf410d7191b19

chore: update doc

ppoppinlp committed 7 years ago
Unverified
85f6b8bb5d521970c96235924ec6039f91dd1c52

chore: up dep and doc

ppoppinlp committed 7 years ago
Unverified
ffcdf386a3c191843681881b3c33afc68708d8d0

fix readme

ppoppinlp committed 10 years ago
Unverified
4e09a6496d646ce74e6118ebf77cb9107bd2c626

fix license

ppoppinlp committed 10 years ago
Unverified
07f08b6b248322df62fd4a12fc6b3d69673b5764

0.0.1 init

ppoppinlp committed 10 years ago
Unverified
f4540b3132affb744825edd82fb868af8ba0266a

Initial commit

ppoppinlp committed 10 years ago

README

The README file for this repository.

node-pinyin-string

Build Status Code style Dependency Status Dev Dependency Status NPM version NPM downloads NPM license

将中文的汉字转化成拼音字符串。

特性

  • 将汉字转化为拼音字符串

安装

通过 npm:

npm i node-pinyin-string

通过 yarn:

yarn add node-pinyin-string

用法

const pinyin = require(“pinyin-string”);
console.log(pinyin('你好')); // nǐhǎo

参数

这个包的汉字识别功能依赖于这个项目,所有的参数会透传过去,具体参数的含义可以移步那边查阅。

sep

设置合并成字符串时候的分隔符,例如:

pinyin('加一下分隔符吧,不然好奇怪呀思密达', {
	style: pinyin.STYLE_NORMAL,
	sep: ' '
});
// jia yi xia fen ge fu ba , bu ran hao qi guai ya si mi da