Socket
Socket
Sign inDemoInstall

pinyin-initial

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pinyin-initial

Proxy for JavaScript errors, a better way to handle errors.


Version published
Weekly downloads
3
Maintainers
1
Install size
47.8 kB
Created
Weekly downloads
 

Readme

Source

pinyin-initial

一个简单快速获取汉字拼音首字母的库,不能保证所有汉字全覆盖,不支持多音字。主打一个快、内存占用小! 基本原理就是将所有常用汉字的拼音首字母按照 charCode 枚举到添加一个字符串中,传入的汉字根据 charCode 从字符串中反查出对应的拼音首字母。

安装

npm

npm install pinyin-initial

yarn

yarn add pinyin-initial

pnpm

pnpm add pinyin-initial

使用

import { getPinyinInitial } from 'pinyin-initial';

console.log(getPinyinInitial('一')); // Y

Keywords

FAQs

Last updated on 22 May 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc