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

hpolyfill

v0.23.0

Published

A lightweight polyfill lib.

Downloads

13

Readme

HPolyfill

This is a lightweight(less than 10KB) polyfill lib which includes some common polyfills.

Usage

Just simply include one of the following script tags in your HTML to get the polyfills:

<!-- via jsdelivr -->
<script type="text/javascript" crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/hpolyfill@latest/dist/index.js"></script>
<!-- or via unpkg -->
<script type="text/javascript" crossorigin="anonymous" src="https://unpkg.com/hpolyfill@latest/dist/index.js"></script>

By the way, as a polyfill lib, this lib should be loaded first in most cases.

Polyfill list

  • Set
    • basic functionality
    • constructor arguments
    • convert -0 key into +0
    • set.add() returning this
    • set.forEach()
    • set.delete()
    • set.clear()
    • set.size
    • set[Symbol.iterator]()
  • Map
    • basic functionality
    • constructor arguments
    • convert -0 key into +0
    • map.set() returning this
    • map.forEach()
    • map.delete()
    • map.clear()
    • map.size
    • map[Symbol.iterator]()
  • Promise
    • basic functionality
    • Promise.all()
    • Promise.allSettled()
    • Promise.race()
    • Promise.resolve()
    • Promise.reject()
    • promise.finally()
  • Array
    • Array.from()
    • Array.of()
    • array.includes()
    • array.fill()
    • array.find()
    • array.findIndex()
    • array.flat()
    • array.flatMap()
    • array.keys()
    • array.values()
    • array.entries()
    • array[Symbol.iterator]()
  • Object
    • Object.assign()
    • Object.is()
    • Object.keys()
    • Object.values()
    • Object.entries()
    • Object.fromEntries()
  • Number
    • Number.isNaN()
    • Number.isFinite()
  • Math
    • Math.sign()
    • Math.trunc()
  • String
    • String.raw()
    • string.includes()
    • string.repeat()
    • string.startsWith()
    • string.endsWith()
    • string.padStart()
    • string.padEnd()
    • string.trimStart()
    • string.trimEnd()
    • string[Symbol.iterator]()
  • Symbol
    • basic functionality
    • Symbol.for()
    • Symbol.keyFor()
    • Symbol.iterator
    • symbol.description
  • RAF
    • requestAnimationFrame()
    • cancelAnimationFrame()
  • Performance
    • performance.timeOrigin
    • performance.now()
  • Fetch (partial)
    • fetch()
    • Headers()
    • Request()
    • Response()

Fetch Polyfill Details

This polyfill lib only provides a partial implemention of the Fetch APIs. Since XMLHttpRequest is used internally, some features are not available.

Here are the polyfill details:

  • fetch(resource, init?)
    • resource can be either an url string or an instance of Request
    • init is optional and only accepts the following options:
      • method - request method
      • credentials - no cookies if set to 'omit'; otherwise, attach cookies
      • headers - either an instance of Headers, or an array of string arrays, or a plain object representing headers
  • Headers(init?)
    • full support
  • Request(resource?, init?)
    • resource and init are similar to fetch()
    • request.clone(), request.json() and request.text() are supported
  • Response(body?, init?)
    • body - optional response body
    • init - optional options
    • response.ok - true if the status code is between 200 and 299; false otherwise
    • response.clone(), response.json() and response.text() are supported

ps

If you find any problem with this lib or something necessary but not included, feel free to open an issue.