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

polliwog

v0.2.0

Published

Making HTTP polling less annoying for everyone.

Readme

Polliwog

Sometimes it's unavoidable. The only way to get updates from that web service you love is to nag at it, endlessly repeating the same HTTP request like a child who's grown tired of the car ride. Polliwog manages the details so that you can focus on the data.

Features

  • Transforms a URL into an EventEmitter stream of data events.
  • Cache-hint awareness means fewer unnecessary HTTP requests by default.
  • Response de-duplication keeps your application from re-processing the same data over and over again.

Getting Started

There's no better way to explain Polliwog than with an example.

const url = 'http://date.jsontest.com'
const options = { json: true }

const p = new Polliwog(url, options)
p.on('response', console.log)
p.start()

Configuration

The Polliwog constructor takes two arguments, he HTTP or HTTPS URL to poll, and an optional hash of configuration options.

The following configuration options are supported.

interval (default: 500)

Specifies the polling interval, in milliseconds.

json (default: false)

When true, response bodies will be parsed as JSON.

emitUnchanged (default: false)

When true, events will be fired following every request (rather than when data has changed).

skipCache (default: false)

When true, locally cached data will always be considered expired. Note that on its own, this will still result in conditional requests based on the Etag and Last-Modified headers being made.

skipEtag (default: false)

When true, Etags will not be considered when testing cache validity.

skipLastModified (default: false)

When true, the Last-Modified date will not be considered when testing cache validity.

Events

'response' => (code, headers, body)

Produces a stream of HTTP responses, regardless of HTTP status code.

success => (body)

Produces a stream of successful HTTP responses (2xx).

failure => (body)

Produces a stream of unsuccessful HTTP responses (4xx and 5xx).

error => (err)

Produces a stream of exceptions, from networking failures to JSON parsing errors.

API

new Polliwog(url, options)

Constructs a new poller for the specified URL. See Configuration for a list of the supported options.

on(event, callback)

addListener(event, callback)

Registers a new callback for the named event. See Events for a list of the supported events.

removeListener(event, callback)

Unregisters a callback from the named event.

start()

Begins polling the URL for data and firing the appropriate events.

stop()

Terminates the current polling cycle and aborts any further data processing. Events for any outstanding requests may still be fired after this method is called.