Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add detailed usage into the markdown files #128

Open
tokyojava opened this issue Jul 22, 2024 · 1 comment
Open

Add detailed usage into the markdown files #128

tokyojava opened this issue Jul 22, 2024 · 1 comment

Comments

@tokyojava
Copy link

Hi there, I am considering adding some hands-on code usage to your repo as I find reading textual description quite hard.
If you think it is good, I am gonna create a PR for the README.md file

const lite = require('caniuse-lite');

// get agent usage data
console.log(lite.agents.ie); //this can apply to chrome, firefox

// get feature support as per browser
// check the support of "acc" feature
// you need to get the compressed data first
const aac = lite.features["aac"];
// use the feature method to get the uncompressed data
const parsedAac = lite.feature(aac);
console.log(parsedAac);

// get per region data
// you need to get the compressed data first 
const chinaData = require("caniuse-lite/data/regions/CN");
// use the region method to get the uncompressed data
console.log(lite.region(chinaData));

@ai
Copy link
Member

ai commented Jul 22, 2024

Yes, please. An example is a great additional to API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants