Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
pinyin-pro
Advanced tools
pinyin-pro
是一个专业的 js 汉字拼音转换库,功能丰富、准确率高、性能优异。
npm 安装
npm install pinyin-pro
浏览器引入
<script src="https://unpkg.com/pinyin-pro"></script>
更多功能的使用说明文档请查看使用示例
import { pinyin } from 'pinyin-pro';
// 获取带音调拼音
pinyin('汉语拼音'); // 'hàn yǔ pīn yīn'
// 获取数组形式带音调拼音
pinyin('汉语拼音', { type: 'array' }); // ["hàn", "yǔ", "pīn", "yīn"]
// 获取数组形式不带声调的拼音
pinyin('汉语拼音', { toneType: 'none', type: 'array' }); // ["han", "yu", "pin", "yin"]
// 获取带音调韵母
pinyin('汉语拼音', { pattern: 'final' }); // 'àn ǔ īn īn'
以下是 pinyin-pro
及 pinyin
包对于汉字转换的速度及准确率对比,更多细节可以参考
对比项 | pinyin | pinyin-pro |
---|---|---|
准确率 | 95.894% | 99.744% |
5k 字转换所需时间 | 190.192ms | 7.199ms |
1w 字转换所需时间 | 内存溢出转换失败 | 13.199ms |
100w 字转换所需时间 | 内存溢出转换失败 | 646.973ms |
使用遇到问题或者需要功能支持欢迎提 issue。
技术交流欢迎加 pinyin-pro 用户群 或者微信:
FAQs
We found that pinyin-pro demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.