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

sw-proxy

v0.9.1

Published

A RFC-compliant HTTP proxy library for service workers.

Downloads

22

Readme

Build Status

HTTP Proxy Proof-of-Concept

This is not an official Google product!

Motivation

Perhaps surprisingly, the service worker cache does not behave like a standard HTTP cache; http-proxy.js attempts to implement an RFC 7234 and RFC 5861 compliant HTTP proxy suitable for use within a service worker.

Some reasons for investigating this:

  • Is it possible to polyfill HTTP features browsers don't support? Browsers support some, but not all, of the standard cache control headers. For example, no browser implements stale-while-revalidate or stale-if-error (though stale-while-revalidate may arrive in Chrome at some point). Is it possible to provide a useful polyfill for these cache control headers? (This may be particularly useful in the future if foreign fetch is implemented.)
  • Is it possible to implement different caching strategies on top of HTTP? HTTP has sophisticated, well-defined, and well-understood caching features, and so it might make sense to implement different caching strategies via simple header-manipulating wrappers on top of a generic HTTP proxy, instead of writing strategy-specific cache manipulation code with a custom configuration language. Is this a viable approach?

Examples (currently broken)

To view the examples:

$ yarn # or npm install
$ yarn start
# open http://127.0.0.1:8000/

Recommendations:

  • Keep the "server" terminal window open to see when requests are really made.
  • Open DevTools.
  • Turn on network throttling to the slowest speed.

Notes:

  • The cache and service workers are reset every time index.html is loaded.
  • The examples are initiated via an interstitial page that installs and activates the service worker. This is slightly ugly, but it makes the examples a lot easier to follow.

Tests

There aren't many tests at the moment, but what tests there are can be run via:

$ yarn test # or npm test

Author

Michael Stillwell <[email protected]>