A smaller version of caniuse-db, with only the essentials!
Installations
npm install caniuse-lite
Releases
Unable to fetch releases
Developer
browserslist
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
22.11.0
NPM Version
10.9.0
Statistics
551 Stars
1,642 Commits
77 Forks
8 Watching
1 Branches
18 Contributors
Updated on 25 Nov 2024
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
8,670,686,806
Last day
-1.4%
11,131,166
Compared to previous day
Last week
4.6%
60,744,530
Compared to previous week
Last month
18.5%
243,493,214
Compared to previous month
Last year
19.1%
2,390,377,299
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
No dependencies detected.
caniuse-lite
A smaller version of caniuse-db, with only the essentials!
Why?
The full data behind Can I use is incredibly useful for any front end developer, and on the website all of the details from the database are displayed to the user. However in automated tools, many of these fields go unused; it's not a problem for server side consumption but client side, the less JavaScript that we send to the end user the better.
caniuse-lite then, is a smaller dataset that keeps essential parts of the data
in a compact format. It does this in multiple ways, such as converting null
array entries into empty strings, representing support data as an integer rather
than a string, and using base62 references instead of longer human-readable
keys.
This packed data is then reassembled (via functions exposed by this module) into a larger format which is mostly compatible with caniuse-db, and so it can be used as an almost drop-in replacement for caniuse-db for contexts where size on disk is important; for example, usage in web browsers. The API differences are very small and are detailed in the section below.
API
1import * as lite from 'caniuse-lite';
lite.agents
caniuse-db provides a full data.json
file which contains all of the features
data. Instead of this large file, caniuse-lite provides this data subset
instead, which has the browser
, prefix
, prefix_exceptions
, usage_global
and versions
keys from the original.
In addition, the subset contains the release_date
key with release dates (as timestamps) for each version:
1{ 2 "release_date": { 3 "6": 998870400, 4 "7": 1161129600, 5 "8": 1237420800, 6 "9": 1300060800, 7 "10": 1346716800, 8 "11": 1381968000, 9 "5.5": 962323200 10 } 11}
lite.feature(js)
The feature
method takes a file from data/features
and converts it into
something that more closely represents the caniuse-db
format. Note that only
the title
, stats
, status
, and shown
keys are kept from the original data.
lite.features
The features
index is provided as a way to query all of the features that
are listed in the caniuse-db
dataset. Note that you will need to use the
feature
method on values from this index to get a human-readable format.
lite.region(js)
The region
method takes a file from data/regions
and converts it into
something that more closely represents the caniuse-db
format. Note that only
the usage data is exposed here (the data
key in the original files).
License
The data in this repo is available for use under a CC BY 4.0 license (http://creativecommons.org/licenses/by/4.0/). For attribution just mention somewhere that the source is caniuse.com. If you have any questions about using the data for your project please contact me here: http://a.deveria.com/contact
Security contact information
To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.
No vulnerabilities found.
Reason
30 commit(s) and 5 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: Creative Commons Attribution 4.0 International: LICENSE:0
Reason
0 existing vulnerabilities detected
Reason
Found 0/26 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: topLevel 'contents' permission set to 'write': .github/workflows/check.yml:9
- Info: topLevel 'contents' permission set to 'read': .github/workflows/test.yml:8
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/check.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/browserslist/caniuse-lite/check.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/check.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/browserslist/caniuse-lite/check.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/check.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/browserslist/caniuse-lite/check.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/browserslist/caniuse-lite/test.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/browserslist/caniuse-lite/test.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/browserslist/caniuse-lite/test.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/browserslist/caniuse-lite/test.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/browserslist/caniuse-lite/test.yml/main?enable=pin
- Info: 0 out of 6 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 third-party GitHubAction dependencies pinned
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 4 are checked with a SAST tool
Score
4.4
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to caniuse-lite
update-browserslist-db
CLI tool to update caniuse-lite to refresh target browsers from Browserslist config
@types/caniuse-lite
TypeScript definitions for caniuse-lite
browserslist
Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-env-preset
caniuse-api
request the caniuse data to check browsers compatibilities