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

@shgysk8zer0/polyfills

v0.4.8

Published

A collection of JavaScript polyfills

Downloads

1,273

Readme

@shgysk8zer0/polyfills

@shgysk8zer0/polyfills is a collection of JavaScript polyfills designed to provide modern functionality in older browsers. This library provides a range of polyfills for features including AbortSignal, CookieStore, Sanitizer, and many more.

CodeQL Node CI Lint Code Base

GitHub license GitHub last commit GitHub release GitHub Sponsors

npm

NPM Unpacked Size npm

GitHub followers GitHub forks GitHub stars Twitter Follow

Donate using Liberapay


Installation

You can access @shgysk8zer0/polyfills in several ways:

CDN

You can use a CDN to access the library. Add the following script tag to your HTML file to load the latest version:

<script src="https://unpkg.com/@shgysk8zer0/polyfills[@version]/all.min.js"></script>

With version and SRI

<script src="https://unpkg.com/@shgysk8zer0/[email protected]/all.min.js" referrerpolicy="no-referrer" crossorigin="anonymous" integrity="sha384-xoY6kDRPTvbDfGdGA3S6Ercudev5mWGBWZIErLB38f7TeN6hV7zof6WBpzMdx/z0" fetchpriority="high" defer=""></script>

NPM

You can install the library as an NPM package and use it in your project. Use the following command to install the library:

npm install @shgysk8zer0/polyfills

[!Note] If using this polyfills package in a node environment, you want to use node.js instead of all.js. The node version omits polyfills that do not make sense in NodeJS, such as DOM. Simply using import '@shgysk8zer0/polyfills' or require('@shgysk8zer0/polyfills') should work.

Git Submodule

You can add the library as a Git submodule to your project. Use the following command to add the library as a submodule:

git submodule add https://github.com/shgysk8zer0/polyfills.git [:path/to/destination]

Usage

To use the polyfills in your project, simply import them using ES6 modules:

import '@shgysk8zer0/polyfills';
// Or
import 'https://unpkg.com/@shgysk8zer0/polyfills/all.js';

This will load all the polyfills in the library.

If you only need certain polyfills, you can import them individually:

import '@shgysk8zer0/polyfills/sanitizer.js';
import '@shgysk8zer0/polyfills/trustedTypes.js';
import '@shgysk8zer0/polyfills/elementInternals.js';

Import Map

You can avoid installing altogether while keeping the familiar syntax by using an import map. If you use Rollup, see @shgysk8zer0/rollup-import. for more details.

<script type="importmap">
{
  "imports": {
    "@shgysk8zer0/polyfills": "https://unpkg.com/@shgysk8zer0/[email protected]/all.min.js",
    "@shgysk8zer0/polyfills/": "https://unpkg.com/@shgysk8zer0/[email protected]/",
  }
}
</script>

Contributing

If you would like to contribute to the library, please follow these steps:

  1. Fork the repository.
  2. Create a branch for your changes.
  3. Make your changes.
  4. Submit a pull request.

Please make sure that your changes are thoroughly tested and that they follow the same coding style as the rest of the library.

License

@shgysk8zer0/polyfills is licensed under the MIT license. See the LICENSE file for more details.