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

super-unit

v1.3.0

Published

js tool

Downloads

6

Readme

super-unit

介绍

一款前端实用工具库

软件架构

软件架构说明

发布 npm

  1. npm login
  • 先要在 npmjs.org 官网注册 npm 账号,然后再项目中执行 npm login 登录
  1. npm publish
  • 在执行 npm publish 发布这个包。注意 package.json 文件的 private 不能是 true,否则不能发布

安装教程

  1. xxxx
  2. xxxx
  3. xxxx

使用说明

  1. xxxx
  2. xxxx
  3. xxxx
  常用type:
  feat:新功能(feature)update:更新change:修改
  fix:修补bug
  docs:文档(documentation)
  style: 格式(不影响代码运行的变动)
  refactor:重构(即不是新增功能,也不是修改bug的代码变动)
  test:增加测试
  chore:构建过程或辅助工具的变动

参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request

特技

  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. Gitee 官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解 Gitee 上的优秀开源项目
  4. GVP 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
  5. Gitee 官方提供的使用手册 https://gitee.com/help
  6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 https://gitee.com/gitee-stars/

API

时间

dateToString(date[, type="YYYY-MM-DD hh:mm:ss"])

  • 将日期 转成 YYYY-MM-DD hh:mm:ss 格式 或者 YYYY/MM/DD hh:mm:ss
  • date 不传 则是 当前时间 new Date();
  • type 的值 可以是 YYYY-MM-DD hh:mm:ss、YYYY-MM-DD、YYYY/MM/DD hh:mm:ss YYYY/MM/DD
dateToString(new Date()); //2022-02-03 16:23:23
dateToString(new Date(), "YYYY/MM/DD hh:mm:ss"); //2022/02/03 16:23:23

spaceTime(target)

  • 返回当前 距离 目标时间 还有 多少时间。
  • 放回对象 {day, hour, minute, second}
  • target 参数:字符串目标日期, 如:2022-12-12
spaceTime("2022-02-04 12:23:12"); // {day: 1, hour: 5, minute: 12: second: 12}

工具函数

cloneDeep(target)

  • 深拷贝