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 🙏

© 2026 – Pkg Stats / Ryan Hefner

textjstools

v1.0.11

Published

this is about javascript object function package

Readme

textjstools

DavidDavidDavid

author

CJerryG

About

textjstools 是一个javascript 函数库扩展。您可以尽情的使用它,您也可以按需加载。

该函数库为测试库(功能还不够完善。如有建议,可以lssues;如因为错误所造成的后果,请您见谅!)

Build Setup

install dependencies

$ npm install --save textjstools

import textjstools

import textjstools from 'textjstools'

demand import

import {toStr} form 'textjstools'

Characteristic

  • [x] 水仙花树(Narcissus)
  • [x] 阶乘 (factorials)
  • [x] 数组去重(Array to remove duplicate)
  • [ ] 深度克隆 (Deep cloning)
  • [ ] 对象深度合并(Object depth merge)
  • [ ] 算法 (Javascript algorithm)

Content list

dataType.js

| 名称 | 描述 | 参数 | 返回值 | | --------------- | ----------------- | ------ | ------------------- | | isUndefined | 是否为Undefined | any | true|false | | isNumber | 是否为Number | any | true|false | | isString | 是否为String | any | true|false | | isBoolean | 是否为Boolean | any | true|false | | isNull | 是否为Null | any | true|false | | isFunction | 是否为Function | any | true|false | | isObject | 是否为Object | any | true|false | | isNaN | 是否为NaN | any | true|false | | isArrayObject | 是否为ArrayObject | any | true|false | | isNumberObject | 是否为NumberObject | any | true|false | | isStringObject | 是否为StringObject | any | true|false | | isBooleanObject | 是否为BooleanObject | any | true|false | | isSymbol | 是否为Symbol | any | true|false | | isBigint | 是否为Bigint | any | true|false |

numberfun.js

| 名称 | 描述 | 参数 | 返回值 | | ----------- | -------------------------------------------- | ------ | ------------------- | | evenNums | 是否为偶数 | Number | true|false | | oddNum | 是否为奇数 | Number | true|false | | primeNum | 是否为质数(大于1且只能被1或自身整除) | Number | true|false | | primeNumArr | 返回2 至 该数的质数集合 | Number | [...] | | totalNum | 是否为合数(大于1且可以被其他数整除,除了0) | Number | true|false | | totalNumArr | 返回2至该数的合数集合 | Number | [...] | | toNum | 强制转换成Number | any | Number|NaN | | toPrice | 保留n位小数(四舍五入) | Number | String | | toPrice1 | 保留n位小数(不四舍五入) | Number | String | | toPrice2 | 不处理小数部分 | Number | String |

stringfun.js

| 名称 | 描述 | 参数 | 返回值 | | --------- | ------------------ | ------------------------------------------------- | ------ | | toStr | 强制转换成String | any | String | | toFillStr | 填充元素 | StringNumber:从哪填充String:填充的元素 | String | | | | | |

array.js

| 名称 | 描述 | 参数 | 返回值 | | --------- | ------------------ | ------------------------------------------------- | ------ | | unique | 数组去掉重复的元素| array |array|

Examples

import textjstools from 'textjstools';
const arr = textjstools.primeNum(12);//[2,3,5,7,11]
import {totalNumArr} from 'textjstools';
const arr = totalNumArr(12);//[4,6,8,9,10,12]

Communication

vx:GJteams(合作注明来意)

github:https://github.com/getJerryG

Plate

  • Number
  • String
  • Arrray
  • Object
  • dataType
  • browser
  • Mode

expect

更多功能敬请期待,欢迎共同创造!