Get started with pinyin-pro CDN
MIT licensed
Pinyin-pro is a library that converts Chinese characters into their corresponding Pinyin pronunciations.
Tags:- 拼音
- pinyin
- 汉字
- 中文
- 首字母
- 韵母
- 声母
- 音调
Stable version
Copied!
How to start using pinyin-pro CDN
// Import the pinyin-pro library
const Pinyin = require('pinyin-pro/dist/index.js');
// Create an instance of the Pinyin class
const pinyin = new Pinyin();
// Convert a Chinese character to Pinyin
const chineseCharacter = '中';
const pinyinResult = pinyn.getFullPinyin(chineseCharacter, { tone: 2 });
console.log(pinyinResult); // zhōng (tones: 2)
// Convert a Chinese word to Pinyin
const chineseWord = '中国';
const pinyinResultWord = pinyn.getFullPinyin(chineseWord);
console.log(pinyinResultWord); // zhōngguó
Copied!
Copied!
All versions
3.10.0
3.10.1
3.10.2
3.11.0
3.12.0
3.12.0-alpha.1
3.13.0
3.13.1
3.13.2
3.14.0
3.14.1-beta.1
3.15.0
3.15.1
3.15.1-beta.1
3.15.2
3.15.3
3.15.4
3.16.0
3.16.1
3.16.2
3.16.3
3.16.4
3.16.5
3.16.6
3.16.7
3.17.0
3.18.0
3.18.1
3.18.2
3.18.3
3.18.4
3.18.5
3.18.6
3.19.0
3.19.1
3.19.2
3.19.3
3.19.4
3.19.5
3.19.6
3.19.7
3.20.0
3.20.0-beta.1
3.20.0-beta.2
3.20.0-beta.3
3.20.0-beta.4
3.20.0-beta.5
3.20.0-beta.6
3.20.1
3.20.2
3.20.3
3.20.4
3.21.0
3.21.1
3.22.0
3.22.1
3.22.2
3.23.0
3.23.1
3.24.0
3.24.1
*** 3.24.2
3.8.2
3.8.3
3.9.0