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

caniuse-cmd

v1.3.1

Published

caniuse for the command line

Downloads

379

Readme

caniuse-cmd

Just what you've always wanted, it's a caniuse command line tool! All the power of caniuse.com with none of the nice UI or interactivity!

How do?

Install with npm install -g caniuse-cmd.

Then type things like this:

$ caniuse websockets
Web Sockets ✔ 85.22% ◒ 1.35% [W3C Candidate Recommendation]
  Bidirectional communication technology for web apps #JSAPI

  IE ✘ 5.5+ ✔ 10+
  Firefox ✘ 2+ ◒ 4+¹ ◒ 6+ᵖ² ✔ 11+
  Chrome ◒ 4+¹ ◒ 15+² ✔ 16+
  Safari ✘ 3.1+ ◒ 5+¹ ◒ 6+² ✔ 7+
  Opera ✘ 9+ ◒ 11+¹ ✔ 12.1+

    ¹Partial support refers to the websockets implementation using an older version of the protocol and/or the
    implementation being disabled by default (due to security issues with the older protocol).
    ²Partial support refers to lacking support for binary data.

(The output has truly marvellous colours that this markdown is too narrow to contain.)

Or this:

$ caniuse input
caniuse input
HTML5 form features ✔ 4.21% ◒ 82.39%
  IE ✘ 5.5+ ◒ 10+ Firefox ✘ 2+ ◒ 4+ Chrome ◒  Safari ✘ 3.1+ ◒ 4+ Opera ✔ 9+ ◒ 15+
Spellcheck attribute ✔ 60.31% ◒ 31.63%
  IE ✘ 5.5+ ✔ 10+ Firefox ✔  Chrome ✘ 4+ ✔ 9+ Safari ✘ 3.1+ ✔ 5.1+ Opera ✘ 9+ ✔ 10.5+
Range input type ✔ 87.46% ◒ 1.18%
  IE ✘ 5.5+ ✔ 10+ Firefox ✘ 2+ ✔ 23+ Chrome ‽ 4+ ✔ 5+ Safari ✔  Opera ✔
Date and time input types ✔ 60.76% ◒ 0%
  IE ✘  Firefox ✘  Chrome ✘ 4+ ✔ 20+ Safari ✘  Opera ✔
Color input type ✔ 60.93% ◒ 3.84%
  IE ✘  Firefox ✘ 2+ ✔ 29+ Chrome ✘ 4+ ✔ 20+ Safari ✘  Opera ✘ 9+ ✔ 11+ ✘ 15+ ✔ 17+
Number input type ✔ 49.95% ◒ 38.03%
  IE ✘ 5.5+ ◒ 10+ Firefox ✘ 2+ ✔ 29+ Chrome ✘ 4+ ✔ 6+ Safari ✘ 3.1+ ✔ 5+ Opera ✔
input placeholder attribute ✔ 88.04% ◒ 1.15%
  IE ✘ 5.5+ ✔ 10+ Firefox ✘ 2+ ✔ 4+ Chrome ✔  Safari ◒ 3.1+ ✔ 5+ Opera ✘ 9+ ◒ 11+ ✔ 11.5+
Pointer events ✔ 8.5% ◒ 1.67%
  IE ✘ 5.5+ ◒ 10+ᵖ ✔ 11+ Firefox ✘  Chrome ✘  Safari ✘ 3.1+ ‽ 6.1+ Opera ✘
Web Speech API
  IE ✘  Firefox ✘  Chrome ✘ 4+ ◒ 25+ᵖ Safari ✘ 3.1+ ◒ 6.1+ᵖ ◒ 7.1+ Opera ✘
Multiple file selection ✔ 67.63% ◒ 0%
  IE ✘ 5.5+ ✔ 10+ Firefox ✘ 2+ ✔ 3.6+ Chrome ✘ 4+ ✔ 5+ Safari ✘ 3.1+ ✔ 4+ Opera ✘ 9+ ✔ 10.6+
Gamepad API ✔ 46.08% ◒ 0%
  IE ✘  Firefox ✘ 2+ ✔ 29+ Chrome ✘ 4+ ✔ 21+ᵖ ✔ 25+ Safari ✘  Opera ✘ 9+ ✔ 24+
Pattern attribute for input fields ✔ 72.88% ◒ 0.7%
  IE ✘ 5.5+ ✔ 10+ Firefox ✘ 2+ ✔ 4+ Chrome ✘ 4+ ✔ 10+ Safari ✘  Opera ✘ 9+ ✔ 9.5-9.6+

Does it have lots of command line options?

Yes!

$ caniuse --help
Options:
Options:
  --short, -s            Short output: show browsers on one line and don't
                         display notes or description (default when displaying
                         multiple results)                             [boolean]
  --long, -l             Long output: show more information (default when
                         displaying a single result)                   [boolean]
  --oneline, -1          One-line output: just global percentages, no per-
                         browser info                 [boolean] [default: false]
  --oneline-browser, -2  One-line output with browser info, implies --abbrev and
                         --current                    [boolean] [default: false]
  --abbrev, -a           Abbreviate browser names     [boolean] [default: false]
  --percentages, -p      Include browser version usage percentages
                                                      [boolean] [default: false]
  --future, -f           Include future browser versions
                                                      [boolean] [default: false]
  --current, -c          Don't include old browser versions, equivalent to --era
                         e0                           [boolean] [default: false]
  --era, -e              How many versions back to go, e0 to e-40       [string]
  --mobile, -m           Include mobile browsers      [boolean] [default: false]
  --desktop, -d          Include desktop browsers      [boolean] [default: true]
  --browser, -b          Show results for these browsers, comma-separated (ie,
                         edge,firefox,chrome,safari,opera,ios_saf,op_mini,
                         android,bb,op_mob,and_chr,and_ff,ie_mob,and_uc)
                                                                        [string]
  --web, -w              Go to the search page on caniuse.com
                                                      [boolean] [default: false]
  --config, -C           Path to JSON config file
                                 [string] [default: "/Users/user/.caniuse.json"]
  --ascii, -A            UTF-8 symbols replacement with ASCII description
                                                      [boolean] [default: false]
  --help                 Show help                                     [boolean]

Woah, that's a lot of options! Can haz config file?

Yes! You can specify your own defaults by creating a file called .caniuse.json and putting it in your home directory.

For example, if you're primarily interested in mobile browsers two versions back:

{
  "era": "e-2",
  "mobile": true,
  "desktop": false
}