1. pyfl
获取拼音首字母
pyfl
Package: pyfl
Created by: Nbsaw
Last modified: Fri, 13 May 2022 18:09:00 GMT
Version: 1.1.4
License: MIT
Downloads: 240
Repository: https://github.com/Nbsaw/pyfl

Install

npm install pyfl
yarn add pyfl

PYFL

https://circleci.com/gh/Nbsaw/pyfl/tree/master
https://www.npmjs.com/package/pyfl
https://www.npmjs.com/package/pyfl
https://www.npmjs.com/package/pyfl

一个并不轻量级(~20kb)的 Web 端获取拼音首缩写.大部分字都可以测试通过

PREFACE

在做某个项目的时候要用到了,现在把这个库开源出来。魔改自pinyinjs

INSTALL

 yarn add pyfl

USAGE

只支持传入字符串参数。如果该字符串不存在对应的拼音会反回原字符。

 import pyfl from 'pyfl';

pyfl('喵'); // M

pyfl('好笑吗跟傻子一样整天就知道哈哈哈哈哈哈哈')); // HXMGSZYYZTJZDHHHHHHH

pyfl('罤夶繙着洗'); // TBFZX

pyfl('Pure'); // Pure

pyfl('Made by ❤'); // Made by ❤

FAQ

  • 如何在直接在 Node 端引用 ?

     const pyfl = require("pyfl").default;
    

OTHER

如果这个库对你有帮助的话,希望能在 github 上给个 star。

License

MIT © NBSAW

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin