siwi-pinyin

hanzi to pinyin for nodejs

Usage no npm install needed!

<script type="module">
  import siwiPinyin from 'https://cdn.skypack.dev/siwi-pinyin';
</script>

README

Build Status npm npm Github file size

siwi-pinyin

hanzi to pinyin for nodejs

install

yarn add siwi-pinyin

npm install siwi-pinyin

test

const expect = require('chai').expect
describe('/lib/index.js', () => {
    it('convert',async () => {
        const pinyin = require('../index')
        const hanzi = '还好,欢迎光临';
        const res = await pinyin.convert(hanzi)
        console.log(res)
        expect(res).to.be.equal('hái hǎo ,huān yíng guāng lín ')
    });
});