npm install pinyin-bot-coreconst botCore = require('pinyin-bot-core')
// Default
botCore.processMessage('你的中文很好啊')
.then(console.log) // nǐ de zhōng wén hěn hǎo a
// Pinyin (/p | /pinyin)
botCore.processMessage('/p 你的中文很好啊')
.then(console.log) // nǐ de zhōng wén hěn hǎo a
botCore.processMessage('/p nǐ de zhōng wén hěn hǎo a')
.then(console.log) // ni3 de zhong1 wen2 hen3 hao3 a
botCore.processMessage('/p ni3 de zhong1 wen2 hen3 hao3 a')
.then(console.log) // nǐ de zhōng wén hěn hǎo a
// Split (/s | /split)
botCore.processMessage('/s nidezhongwenhenhaoa')
.then(console.log) // ni de zhong wen hen hao a
botCore.processMessage('/s nǐdezhōngwénhěnhǎoa')
.then(console.log) // nǐ de zhōng wén hěn hǎo a
botCore.processMessage('/s ni3dezhong1wen2hen3hao3a')
.then(console.log) // ni3 de zhong1 wen2 hen3 hao3 apinyin-utilspinyin-splitzhuyinfind-hanzihsk-wordscedictmdbgpinyin-or-hanzihanzi-to-pinyinpinyin-convertpinyin-restpinyin-apipinyin-telegrampinyin-messengerpinyin-linepinyin-chromepinyin-clihanzi-cli
If you have a question, found a bug or want to propose a feature, have a look at the issues page.