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

@github/browser-support

v3.0.1

Published

Polyfills and Capable Browser detection

Downloads

1,309

Readme

browser-support

This library allows websites to maintain compatibility with older browsers, which do not implement newer features. It does so using polyfills for small new features, plus functions to determine if a browser supports a set of features natively or with polyfills.

If you would like to see what features the browser you are currently using implements, you can visit the documentation site which displays a compatibility table that detects which features are natively supported in your browser.

How is this used on GitHub?

We use all of these polyfills on GitHub.com. We also use the isSupported() function to determine if the browser meets a minimum set of functionality which we expect, browser that return false from isSupported() do not send errors or statistics to our backend monitoring.

Installation

$ npm install @github/browser-support

Usage

JS

import {isSupported, isPolyfilled, apply} from '@github/browser-support'

// Check if a browser is supported
if (!isSupported()) {
  apply()
  console.assert(isSupported() === true)
  console.assert(isPolyfilled() === true)
}

Development

npm install
npm test

Contributing

Adding polyfills

Please do not add any polyfills for ECMA features that are Stage 3 or below. We only wish to polyfill features from ECMAScript that are Stage 4 (about to be included in a new years specification) or already specified.

Removing polyfills

Polyfills should only be removed after consulting with the @github/web-systems who will determine if a polyfill can be removed. This code is designed to be kept lightweight, we do not want to ship dozens of kb of polyfills.

As a polyfill is removed, it may be worth adding feature detection to the baseSupport const, to ensure that our baseline moves with our browser support matrix.

License

Distributed under the MIT license. See LICENSE for details.