npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tframe-string

v8.0.7

Published

A utility of string for smpoo tFrame

Downloads

5

Readme

说明

首字母大写

  • upFirst
  @str: 要转换的字符串

汉字转换为拼音字母

  • cn2Py
  @str:要转换的汉字
  @camel:是否按照小驼峰格式输出,默认为 false (否)

获取传入汉字的首字母简写组合(全小写形式)

  • cn2FirstLetter
  @str:要转换的汉字

将不包含中文和特殊符号,且用空格或下划线分隔的字符串转换为小驼峰格式

  • str2littleCamel
  @str:要转换的字符
  输出:如 abc_efg => abcEfg;abc def_hjk => abc_Def_Hjk

对指定的字符串消除首尾空格

  • clearSpaceLR
  @str:要处理的原始字符串

对指定的字符串消除所有空格

  • clearSpaceAll
  @str:要执行处理的原始字符串

检测传入字符串中汉字、英文、特殊字符(不含下划线)的构成情况

  • infoOfStr
 @str:要检测的字符串
 返回值(-1 表示含特殊字符,其他值均不含特殊字符),
	其他值的参见枚举 enum —> sys —> aboutStr

获取指定字符串的第一个字符的字母表示形式

  • getFirstEnLetter
 @str:要执行处理的原始字符串

从传入的获取 tFrame-Designer 格式的字符格式化输出

  • cn2DesignerObj
> 传入纯中文,输出
  {
    code: xxxx, 
    name: Xxxx, 
    namezh: 原字符串,
    filterStr: 原字符首字的全拼首字母小写
  }
> 传入纯英文,或者传入字符中包含特殊字符,输出 null
> 传入中英文混合(中文部分以 A 表示,英文部分以 B 表示,如: A1B1A2)输出
  {
    code: A1B1A2小驼峰, 
    name: A1 的首字母大写 + B1 的小驼峰 + A2 的小驼峰, 
    namezh: A1B1A2,
    filterStr: A1 首字的全拼首字母小写
  }
> 传入 A | B1B2,输出
  {
    code: B1 的全小写 + B2 的小驼峰, 
    name: B1首字母大写 + B2 的小驼峰, 
    namezh: A,
    filterStr: A 首字的全拼首字母小写
  }
> 传入 A | B1 B2 输出
  {
    code: B1的全小写 + B2 的小驼峰,
    name: B1 的首字母大写 + B2 的小驼峰,
    namezh: A,
    filterStr: A 首字的全拼首字母小写
  }( | 号后的部分以空格区分)
> 传入 A1 A2 | B 输出 
  {
    code: b 的小驼峰,
    name: b 的首字母大写,
    namezh: A1A2,
    filterStr: A1 首字的全拼首字母小写
  } ( | 号前的空格将会清除)
> 传入 any | any | any (any 代表任何字符),第二个 | 号后的内容将会忽略

版本变更记录