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

@appliedblockchain/seconds

v0.0.2

Published

Non-diverging seconds interval.

Downloads

13

Readme

Summary

Works similar to setInterval(cb, 1000), but doesn't diverge. setInterval diverges quite quickly loosing seconds.

Snaps to beginning of a second on system's clock.

Calls are protected against clock changes, ie. callback is guaranteed to be called between 0 - 1000 ms on every tick.

Errors thrown in callback are not handled and don't affect interval - it'll continue to tick.

Async callbacks don't affect ticking, ie. if previous tick hasn't finished, new one will be scheduled as normal.

Async errors are not handled as well and won't affect the ticker.

Usage

const start = require('@appliedblockchain/seconds')
const stop = start((t, i) => {
  console.log(t, Date.now(), i)
  if (i === 10) {
    stop()
  }
})

// 1547223508000 1547223508558 0
// 1547223509000 1547223509004 1
// 1547223510000 1547223510004 2
// 1547223511000 1547223511004 3
// 1547223512000 1547223512004 4
// 1547223513000 1547223513002 5
// 1547223514000 1547223514004 6
// 1547223515000 1547223515003 7
// 1547223516000 1547223516004 8
// 1547223517000 1547223517001 9
// 1547223518000 1547223518004 10