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

wing-time

v1.1.2

Published

Yxx use time format ; 一个时间比对。格式化工具

Readme

自用时间管理 npm

timeFormat (str) 传入 YYYY-MM-DD 或者 YYYY-MM-DD hh:mm:ss 获取当前时间

timeSetFormat (date, str) 格式化导入时间。第一参数传入 new Date()可以解析的时间 第二参数传入 YYYY-MM-DD 或者 YYYY-MM-DD hh:mm:ss

getTimeFormat (str, format) 获取时间对应值 str: YYYY-MM-DD hh:mm:ss 格式 或者时间戳格式 format: YYYY 或者 MM 或者 YYYY-MM 格式 得到对应格式

whichType(v) 判断对象类型

timeCompare 比较 2 个时间大小(v1 > v2 返回 1 ; v1 == v2 返回 0 ; v1 < v2 返回 -1) 参数格式最好为入 YYYY-MM-DD 或者 YYYY-MM-DD hh:mm:ss 否则可能引起未知错误

htmlStr 处理 html 特殊字符串

// 使用举例:
// 直接引入对应方法
import { timeFormat } from 'wing-time';
timeFormat('YYYY-MM-DD hh:mm:ss');
// => 当前 年月日 时分秒