1.1.7 • Published 2 years ago
getpinyin v1.1.7
根据汉字获取拼音
npm地址
https://www.npmjs.com/package/getpinyin
安装
npm install getpinyin --save引用
import { getFirstPY, getFullPY } from 'getpinyin'const { getFirstPY, getFullPY } = require('getpinyin')使用
console.log(getFirstPY('国')) // g
console.log(getFirstPY('中国')) // zg
console.log(getFullPY('国')) // guo
console.log(getFullPY('中国')) // zhongguo注意
没有对多音字进行处理