0.1.8 • Published 4 years ago

word-pinyin v0.1.8

Weekly downloads
8
License
ISC
Repository
github
Last release
4 years ago

word-pinyin

Build Status npm size download

Node端汉字转拼音库, 针对小程序设计, 不支持多音字

安装

yarn add word-pinyin

例子

import PinYin from "word-pinyin";

PinYin.getPinyin("你好骚啊") // ni hao sao a
PinYin.getFirstLetter("你好骚啊") // NHSA

方法

getPinyin(chinese: string, splitter: string = ' ') 获取汉字的拼音

  • cinese: 汉字
  • splitter: 字与字之间的分隔符

getFirstLetter(str: string) 获取汉字的拼音首字母

  • str: 汉字

感谢

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago