JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 310
  • Score
    100M100P100Q94696F
  • License MIT

To get chinese pinyin or alphabet from chinese. 从汉字提取拼音,返回首字母大写形式;提取首字母,返回大写形式。

Package Exports

  • chinese-alphabetize
  • chinese-alphabetize/libs/cjs/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (chinese-alphabetize) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Alphabetize · NPM version Build Status Coverage Status code style: prettier

To get chinese pinyin or alphabet from chinese. 从汉字提取拼音,返回首字母大写形式;提取首字母,返回大写形式。

Browsers support

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
iOS Safari
iOS Safari
Opera
Opera
IE8+ Edge+ last 10 versions last 10 versions last 2 versions last 2 versions last 2 versions

Install

npm i chinese-alphabetize -S
or
yarn add chinese-alphabetize

Usage

import Alphabetize, { getFullChars, getCamelChars } from 'chinese-alphabetize'
or
const Alphabetize, { getFullChars, getCamelChars } = require('chinese-alphabetize')

. getFullChars(提取拼音,返回首字母大写形式)

<
Alphabetize.getFullChars('张三')

->
ZhangSan

. getCamelChars(提取首字母,返回大写形式)

<
Alphabetize.getCamelChars('张三铅')
Alphabetize.getCamelChars('张三铅', { checkPolyphone: true })

->
ZSQ
['ZSQ', 'ZSY']

More