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

commonsy

v0.0.23

Published

publcCommon

Downloads

49

Readme

//原生js引用
import sysFun from './node_modules/commonsy/index.js';

1.8版本更新内容

My NPM Package

A simple npm package for publicCommon.

Installation

npm install commonSy

迅雷下载

    const dataTime=new sysFun.XunLeiDownloadUrl('http://localhost');

货币转化样式

   const Amount =new sysFun.formatCurrency(1000.50, 'US', 'USD');

图片压缩

  const image = new sysFun.CompressImage(file, maxWidth, maxHeight, quality);

时间处理

  const image = new sysFun.DateTimeFormatter(2022-10-10 11:11:10, 'yyyy-mm-dd HH:mm:ss');

获取浏览器类型

  const browserType = new sysFun.GetBrowserType();

表单验证

   let formData=[ { val:1735428805, valName:'姓名', lenth:8, rule:/^1[3-9]\d{9}$/, max:11, min:11, validList:['isNull', 'isFormattingError', 'isMax', 'isMin']}]
   const vial=new sysFun.FormValidation(formData);
   console.log(vial.validationData());

1.9版本更新内容

倒计时功能

  const countdown = new sysFun.CountdownTimer("2023-09-26T09:00:00");
  countdown.start();//返回参数为年月日时分秒

2.0版本更新内容

金钱计算功能

  // 示例用法
  const money = new sysFun.Money(100);

  // 使用 operate 方法进行加法运算
  money.add(50);
  console.log(money.toDollars()); // 输出结果为 150.00

  // 使用 operate 方法进行乘法运算
  money.multiply(2);
  console.log(money.toDollars()); // 输出结果为 300.00

  // 使用 calculate 方法进行复杂的数学表达式计算
  const result = Money.calculate('(300 - 50) / 2 + 10');
  const finalMoney = new sysFun.Money(result);
  console.log(finalMoney.toDollars()); // 输出结果为 135.00

2.1版本优化内容

js原生调用方法优化

2.1版本更新内容

  1. 优化代码结构,将一些公共方法提取到单独的文件中,以减少重复代码。