{"name":"caniuse-api","version":"4.0.0","keywords":["caniuse","browserslist"],"license":"MIT","_id":"caniuse-api@4.0.0","maintainers":[{"name":"nyalab","email":"sebastien.balayn@gmail.com"},{"name":"moox","email":"npm@moox.io"}],"homepage":"https://github.com/MoOx/caniuse-api#readme","bugs":{"url":"https://github.com/MoOx/caniuse-api/issues"},"dist":{"shasum":"916db90089176d882d365159f97d9d9900233c8f","tarball":"http://registry-npm.ywwl.com/caniuse-api/download/caniuse-api-4.0.0.tgz","fileCount":7,"integrity":"sha512-B0hQ1OLyJuHTQSOWXvwibWqM6DCoqJdvBA6X1S/53bd4XU7LJ1yurIPlrsouol3mw1jh9pGI4ivubSpmJeIqCA==","signatures":[{"sig":"MEUCIFS8IG7wW1gK2CrqMxKtM4/bcgwEEESDRJm9VDddWrhbAiEAouxCv8MeHvHWdCQxogTW5EwcVW8iTK51L2ZwrKDDXBw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12264,"size":4650,"noattachment":false,"key":"/caniuse-api/-/caniuse-api-4.0.0.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","authors":["nyalab","MoOx"],"gitHead":"9a2a431214f5a5da3265afe31901bf664b3f3d05","scripts":{"lint":"oxlint src","test":"npm run lint && node --disable-warning=MODULE_TYPELESS_PACKAGE_JSON --test test/*.ts","build":"tsc","release":"npx npmpub","prepublishOnly":"npm run build"},"_npmUser":{"name":"moox","email":"npm@moox.io"},"repository":{"url":"git+https://github.com/MoOx/caniuse-api.git","type":"git"},"_npmVersion":"11.6.1","description":"request the caniuse data to check browsers compatibilities","directories":{},"_nodeVersion":"24.11.0","dependencies":{"browserslist":"^4.0.0","caniuse-lite":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"oxlint":"^1.68.0","typescript":"^6.0.3","@types/caniuse-lite":"^1.0.5"},"_npmOperationalInternal":{"tmp":"tmp/caniuse-api_4.0.0_1780428173685_0.5042761221331","host":"s3://npm-registry-packages-npm-production"},"readme":"# caniuse-api\n\n<a href=\"https://github.com/MoOx/react-from-svg?sponsor=1\">\n  <img width=\"140\" align=\"right\" alt=\"Sponsoring button\" src=\"https://github.com/moox/.github/raw/main/FUNDING.svg\">\n</a>\n\n[![npm package version](https://img.shields.io/github/package-json/v/MoOx/caniuse-api) ![npm downloads](https://img.shields.io/npm/dm/caniuse-api)](https://www.npmjs.com/package/caniuse-api)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/MoOx/caniuse-api/test.yml)](https://github.com/MoOx/caniuse-api/actions)\n[![License](https://img.shields.io/github/license/MoOx/caniuse-api)](https://github.com/MoOx/caniuse-api)  \n![My website moox.io](https://img.shields.io/badge/%F0%9F%8C%90-https%3A%2F%2Fmoox.io-gray?style=social)\n[![GitHub followers](https://img.shields.io/github/followers/MoOx?style=social&label=GitHub)](https://github.com/MoOx)\n[![LinkedIn Follow](https://img.shields.io/badge/%F0%9F%91%94-LinkedIn-gray?style=social&link=https%3A%2F%2Fwww.linkedin.com%2Fin%2Fmaxthirouin%2F)](https://www.linkedin.com/in/maxthirouin/)\n[![BlueSky Follow](https://img.shields.io/badge/BlueSky-%20?style=social&logo=bluesky)](https://bsky.app/profile/moox.io)\n[![X Follow](https://img.shields.io/twitter/follow/MoOx?style=social&label=)](https://x.com/MoOx)\n\n> Request [caniuse](https://caniuse.com) data to check browsers compatibilities\n\n## Installation\n\n```console\nnpm install caniuse-api\n```\n\n## Usage\n\n```js\nconst caniuse = require('caniuse-api')\n\ncaniuse.getSupport('border-radius')\ncaniuse.isSupported('border-radius', 'ie 8, ie 9')\ncaniuse.setBrowserScope('> 5%, last 1 version')\ncaniuse.getSupport('border-radius')\n// ...\n```\n\n## API\n\n#### `caniuse.getSupport(feature)`\n\n_ask since which browsers versions a feature is available_\n\n* `y`: Since which browser version the feature is available\n* `n`: Up to which browser version the feature is unavailable\n* `a`: Up to which browser version the feature is partially supported\n* `x`: Up to which browser version the feature is prefixed\n\n```js\ncaniuse.getSupport('border-radius', true)\n/*\n{ and_chr: { y: 67 },\n  and_ff: { y: 60 },\n  and_qq: { y: 1.2 },\n  and_uc: { y: 11.8 },\n  android: { y: 2.1, x: 2.1 },\n  baidu: { y: 7.12 },\n  chrome: { y: 4, x: 4 },\n  edge: { y: 12 },\n  firefox: { a: 2, x: 3.6, y: 3 },\n  ie: { n: 8, y: 9 },\n  ie_mob: { y: 10 },\n  ios_saf: { y: 3.2, x: 3.2 },\n  op_mini: {},\n  op_mob: { n: 10, y: 11 },\n  opera: { n: 10, y: 10.5 },\n  safari: { y: 3.1, x: 4 },\n  samsung: { y: 4 } }\n*/\n```\n\n#### `caniuse.isSupported(feature, browsers)`\n\n_ask if a feature is supported by some browsers_\n\n```js\ncaniuse.isSupported('border-radius', 'ie 8, ie 9') // false\ncaniuse.isSupported('border-radius', 'ie 9') // true\n```\n\n#### `caniuse.find(query)`\n\n_search for a caniuse feature name_\n\nEx:\n\n```js\ncaniuse.find('radius') // ['border-radius']\ncaniuse.find('nothingness') // []\ncaniuse.find('css3')\n/*\n[ 'css3-attr',\n  'css3-boxsizing',\n  'css3-colors',\n  'css3-cursors-grab',\n  'css3-cursors-newer',\n  'css3-cursors',\n  'css3-tabsize' ]\n*/\n```\n\n#### `caniuse.getLatestStableBrowsers()`\n\n_get the current version for each browser_\n\n```js\ncaniuse.getLatestStableBrowsers()\n/*\n[ 'and_chr 67',\n  'and_ff 60',\n  'and_qq 1.2',\n  'and_uc 11.8',\n  'android 67',\n  'baidu 7.12',\n  'bb 10',\n  'chrome 67',\n  'edge 17',\n  'firefox 61',\n  'ie 11',\n  'ie_mob 11',\n  'ios_saf 11.3-11.4',\n  'op_mini all',\n  'op_mob 46',\n  'opera 53',\n  'safari 11.1',\n  'samsung 7.2' ]\n*/\n```\n\n#### `caniuse.getBrowserScope()`\n\n_returns a list of browsers currently used for the scope of operations_\n\n```js\ncaniuse.getBrowserScope()\n/*\n[ 'and_chr',\n  'and_ff',\n  'and_qq',\n  'and_uc',\n  'android',\n  'baidu',\n  'chrome',\n  'edge',\n  'firefox',\n  'ie',\n  'ie_mob',\n  'ios_saf',\n  'op_mini',\n  'op_mob',\n  'opera',\n  'safari',\n  'samsung' ]\n*/\n```\n\n#### `caniuse.setBrowserScope(browserscope)`\n\n_if you do not like the default browser scope, you can set it globally by using this method_\n\n* browserscope should be a 'autoprefixer' formatted string\n\n```js\ncaniuse.setBrowserScope('> 5%, last 2 versions, Firefox ESR, Opera 12.1')\n```\n\n---\n\n## [Changelog](CHANGELOG.md)\n\n## [License](LICENSE)\n","publish_time":1780428173831,"_cnpm_publish_time":1780428173831,"dist-tags":{"latest":"4.0.0"}}