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 🙏

© 2025 – Pkg Stats / Ryan Hefner

day-week

v0.0.2

Published

``` 功能 ```:某年某月天数

Readme

day

monthDays

功能:某年某月天数

参数:String('年-月-日')

返回结果:Number

栗子

monthDays('2020-2')

返回值:29

separateDays

功能:某两天间隔天数

参数:String('年-月-日'), String('年-月-日')

返回结果:Number

栗子

separateDays('2020-2-2', '2020-2-8')

返回值:5

yearToDay

功能:某天是今年第几天

参数:String('年-月-日')

返回结果:Number

栗子

yearToDay('2020-1-2')

返回值:2

afterDay

功能:获取某天间隔多少天之后的日期

参数:String('年-月-日'), Number

返回结果:Number

栗子

yearToDay('2020-9-9', 100)

返回值:1608220800000

week

dayToWeek

功能:日期转为某年的第几周

参数:String('年-月-日')

返回结果:Number

栗子

dayToWeek('2020-1-2')

返回值:1

weekToDay

功能:依据周数获取一周的时间戳

参数:String('年-周数')

返回结果:Array

栗子

weekToDay('2020-35')

返回值:[ 1598227200000, 1598313600000, 1598400000000, 1598486400000, 1598572800000, 1598659200000, 1598745600000 ]

monthWeek

功能:某年的第几个月

参数:String('年-月-日')

返回结果:Object{年,周数}

栗子

monthWeek('2020-9-7')

返回值:{month: 9, week: 1}

monthToWeek

功能:某月从1号开始每周的第一天

参数:String('年-月')

返回结果:Array

栗子

monthToWeek('2020-2')

返回值:[1580515200000, 1580688000000, 1581292800000, 1581897600000, 1582502400000]

返回值

-1:数据错误