mrr.sj.front/node_modules/js-pinyin
丁杰 1aa732ad02 初始化商家app代码 2026-03-24 11:45:13 +08:00
..
dist 初始化商家app代码 2026-03-24 11:45:13 +08:00
.babelrc 初始化商家app代码 2026-03-24 11:45:13 +08:00
LICENSE 初始化商家app代码 2026-03-24 11:45:13 +08:00
README.md 初始化商家app代码 2026-03-24 11:45:13 +08:00
index.d.ts 初始化商家app代码 2026-03-24 11:45:13 +08:00
index.js 初始化商家app代码 2026-03-24 11:45:13 +08:00
package.json 初始化商家app代码 2026-03-24 11:45:13 +08:00
pinyin.js 初始化商家app代码 2026-03-24 11:45:13 +08:00

README.md

汉字转拼音

把汉字转化为拼音字母,由chinalu/JSPinyin改写使用新语法并去掉mootools的依赖

安装

npm install js-pinyin

import pinyin from 'js-pinyin'

使用示例

let pinyin = require('js-pinyin');

pinyin.setOptions({checkPolyphone: false, charCase: 0});

console.log(pinyin.getFullChars('管理员'))
console.log(pinyin.getCamelChars('管理员'))
console.log(pinyin.getCamelChars('1234'))
console.log(pinyin.getCamelChars('english'))
console.log(pinyin.getCamelChars('昕'))
console.log(pinyin.getCamelChars('佛'))
console.log(pinyin.getFullChars('佛'))
console.log(pinyin.getFullChars('凃一二'))
console.log(pinyin.getCamelChars('凃一二'))