Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

js-pinyin

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-pinyin

汉字转换拼音,需要es6语法(let、class等)支持,不依赖其他组件

  • 0.2.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
686
decreased by-39.77%
Maintainers
1
Weekly downloads
 
Created
Source

汉字转拼音

把汉字转化为拼音字母,由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('凃一二'))

Keywords

FAQs

Package last updated on 17 Jul 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc