{"name":"doiuse","version":"6.0.6","description":"Lint CSS for browser support against caniuse database","main":"./exports/index.cjs","type":"module","exports":{"./lib/*":"./lib/*",".":{"require":"./exports/index.cjs","import":"./exports/index.js"},"./stream":{"require":"./exports/stream.cjs","import":"./exports/stream.js"}},"bin":{"doiuse":"bin/cli.js"},"repository":{"type":"git","url":"git+https://github.com/anandthakker/doiuse.git"},"keywords":["lint","css","browser","support","caniuse","stylelint"],"author":{"name":"Carlos Lopez Jr.","email":"clshortfuse@gmail.com","url":"https://github.com/clshortfuse"},"contributors":[{"name":"Robbie Wadley","url":"https://github.com/RJWadley"},{"name":"Anand Thakker","email":"mail@anandthakker.net","url":"http://www.anandthakker.net/"},{"name":"Piotr Kuczynski","email":"piotr.kuczynski@gmail.com","url":"https://github.com/pkuczynski"}],"license":"MIT","bugs":{"url":"https://github.com/anandthakker/doiuse/issues"},"homepage":"https://github.com/anandthakker/doiuse","engines":{"node":">=16"},"dependencies":{"browserslist":"^4.28.1","caniuse-lite":"^1.0.30001760","css-tokenize":"^1.0.1","duplexify":"^4.1.3","multimatch":"^5.0.0","postcss":"^8.5.6","source-map":"^0.7.6","yargs":"^17.7.2"},"devDependencies":{"@types/caniuse-lite":"^1.0.5","@types/duplexify":"^3.6.5","@types/node":"^16.18.126","@types/tap":"^15.0.12","@types/yargs":"^17.0.35","@typescript-eslint/eslint-plugin":"^5.62.0","@typescript-eslint/parser":"^5.62.0","c8":"^7.14.0","caniuse-db":"^1.0.30001760","eslint":"^8.57.1","eslint-config-airbnb-base":"^15.0.0","eslint-plugin-canonical":"^4.18.1","eslint-plugin-import":"^2.32.0","eslint-plugin-jsdoc":"^46.10.1","eslint-plugin-n":"^16.6.2","eslint-plugin-unicorn":"^47.0.0","mock-fs":"^4.14.0","postcss-import":"^14.1.0","postcss-load-config":"^6.0.1","rollup":"^2.79.2","safe-regex":"^2.1.1","tap":"^18.8.0","typescript":"^5.9.3"},"typesVersions":{"*":{"*":["types/*"]}},"scripts":{"pretest":"eslint \"./bin/**/*.js\" \"./data/**/*.js\" \"./utils/**/*.js\" \"./lib/**/*.js\" \"./test/**/*.js\" && tsc --noEmit","test":"c8 tap test/**/*.js","prepare":"rollup -c rollup.config.js","prepublishOnly":"tsc --emitDeclarationOnly","updateFeatures":"scripts/update-caniuse.sh && node scripts/update-features.js"},"tap":{"disable-coverage":true},"_id":"doiuse@6.0.6","gitHead":"6e1f2e0eaa1c69b774a0c5d5f061b7c019b85f12","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-XuPRslcWHhQJ+WjCjimRUcNfhZvOiC0610FsY6WeSlzXvoZYtm6iOpR9K0N4wRoM/lP4i7LatT+IhltAzouSOw==","shasum":"6a21b510b848e517fcb2a4203fb99b1483ea5ffb","tarball":"http://registry-npm.ywwl.com/doiuse/download/doiuse-6.0.6.tgz","fileCount":682,"unpackedSize":394396,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCSANKRP87BWo1JnJn6ziEaa4KvWbxo9GFkToBuXW++/gIhAIa3EsNFvx74vshyyyaJNtWhh1Ro1J2noqJanNA8OOc0"}],"size":103435,"noattachment":false,"key":"/doiuse/-/doiuse-6.0.6.tgz"},"_npmUser":{"name":"shortfuse","email":"clshortfuse@gmail.com"},"directories":{},"maintainers":[{"name":"anandthakker","email":"vestibule@anandthakker.net"},{"name":"ai","email":"andrey@sitnik.ru"},{"name":"pkuczynski","email":"piotr.kuczynski@gmail.com"},{"name":"shortfuse","email":"clshortfuse@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/doiuse_6.0.6_1765650471524_0.6737707699682838"},"_hasShrinkwrap":false,"readme":"[![Build Status](https://github.com/anandthakker/doiuse/actions/workflows/test.yml/badge.svg)](https://github.com/anandthakker/doiuse/actions/workflows/test.yml)\n\n# doiuse\n\nLint CSS for browser support against [Can I use](http://caniuse.com) database.\n\n## Install\n\n```sh\nnpm install -g doiuse\n```\n\n## Usage Examples\n\n### Command Line\n\n```bash\ndoiuse --browsers \"ie >= 9, > 1%, last 2 versions\" main.css\n# or\ncat main.css | doiuse --browsers \"ie >= 9, > 1%, last 2 versions\"\n```\n\n**Sample output:**\n```\n/projects/website/main.css:5:3: CSS3 Box-sizing not supported by: IE (8-11), Chrome (36-38), Safari (8,7.1), Opera (24-25), iOS Safari (8,7.1,8.1), Android Browser (4.1,4.4,4.4.4), IE Mobile (10-11)\n/projects/website/main.css:6:3: CSS3 Box-sizing not supported by: IE (8-11), Chrome (36-38), Safari (8,7.1), Opera (24-25), iOS Safari (8,7.1,8.1), Android Browser (4.1,4.4,4.4.4), IE Mobile (10-11)\n/projects/website/main.css:8:3: CSS user-select: none not supported by: IE (8-9)\n/projects/website/main.css:9:3: CSS user-select: none not supported by: IE (8-9)\n/projects/website/main.css:10:3: CSS user-select: none not supported by: IE (8-9)\n/projects/website/main.css:11:3: CSS user-select: none not supported by: IE (8-9)\n/projects/website/main.css:12:3: CSS user-select: none not supported by: IE (8-9)\n/projects/website/main.css:13:3: Pointer events not supported by: IE (8-10), Firefox (32-33), Chrome (36-38), Safari (8,7.1), Opera (24-25), iOS Safari (8,7.1,8.1), Android Browser (4.1,4.4,4.4.4), IE Mobile (10)\n/projects/website/main.css:14:3: Pointer events not supported by: IE (8-10), Firefox (32-33), Chrome (36-38), Safari (8,7.1), Opera (24-25), iOS Safari (8,7.1,8.1), Android Browser (4.1,4.4,4.4.4), IE Mobile (10)\n/projects/website/main.css:32:3: CSS3 Transforms not supported by: IE (8)\n```\n\nUse `--json` to get output as (newline-delimited) JSON objects.\n\n### JS\n\n```javascript\nimport postcss from 'postcss';\nimport DoIUse from 'doiuse/lib/DoIUse.js';\n\npostcss(new DoIUse({\n  browsers:['ie >= 6', '> 1%'],\n  ignore: ['rem'], // an optional array of features to ignore\n  ignoreFiles: ['**/normalize.css'], // an optional array of file globs to match against original source file path, to ignore\n  onFeatureUsage: (usageInfo) => {\n    console.log(usageInfo.message);\n  }\n})).process(\"a { background-size: cover; }\")\n```\n\nCommonJS syntax is still supported if using `var doiuse = require('doiuse')`.\n\n### Gulp (CommonJS)\n\n```javascript\nvar gulp = require('gulp')\nvar postcss = require('postcss')\nvar doiuse = require('doiuse')\n\ngulp.src(src, { cwd: process.cwd() })\n.pipe(gulp.postcss([\n  doiuse({\n    browsers: [\n      'ie >= 8',\n      '> 1%'\n    ],\n    ignore: ['rem'], // an optional array of features to ignore\n    ignoreFiles: ['**/normalize.css'], // an optional array of file globs to match against original source file path, to ignore\n    onFeatureUsage: function (usageInfo) {\n      console.log(usageInfo.message)\n    }\n  })\n]))\n```\n\n## How it works\n\nIn particular, the approach to detecting features usage is currently quite naive.\n\n<a name=\"features-list\"></a>Refer to the data in [/data/features.js](data/features.js).\n\n- If a feature in that dataset only specifies `properties`, we just use those\n  properties for regex/substring matches against the properties used in the input CSS.\n- If a feature also specifies `values`, then we also require that the associated\n  value matches one of those values.\n\n## API Details\n\n### As a transform stream\n\n```javascript\nvar doiuse = require('doiuse/stream');\n\nprocess.stdin\n  .pipe(doiuse({ browsers: ['ie >= 8', '> 1%'], ignore: ['rem'] }))\n  .on('data', function (usageInfo) {\n    console.log(JSON.stringify(usageInfo))\n  })\n```\n\nYields `UsageInfo` objects as described below.\n\n### As a postcss plugin\n\n`postcss(new DoIUse(opts)).process(css)`, where `opts` is:\n```javascript\n{\n  browsers: ['ie >= 8', '> 1%'], // an autoprefixer-like array of browsers.\n  ignore: ['rem'], // an optional array of features to ignore\n  ignoreFiles: ['**/normalize.css'], // an optional array of file globs to match against original source file path, to ignore\n  onFeatureUsage: function(usageInfo) { } // a callback for usages of features not supported by the selected browsers\n}\n```\n\nAnd `usageInfo` looks like this:\n\n```javascript\n{\n  message: '<input source>: line <l>, col <c> - CSS3 Gradients not supported by: IE (8)',\n  feature: 'css-gradients', // slug identifying a caniuse-db feature\n  featureData: {\n    title: 'CSS Gradients',\n    missing: \"IE (8)\", // string of browsers missing support for this feature.\n    missingData: {\n      // map of browser -> version -> (lack of)support code\n      ie: { '8': 'n' }\n    },\n    caniuseData: { // data from caniuse-db/features-json/[feature].json }\n  },\n  usage: {} //the postcss node where that feature is being used.\n}\n```\n\nCalled once for each usage of each css feature not supported by the selected browsers.\n\n### Ignoring file-specific rules\n\nFor disabling some checks you can use just-in-place comments\n\n##### `/* doiuse-disable */`\n\nDisables checks of _all [features](#features-list)_\n\n##### `/* doiuse-disable feature */`\n\nDisables checks of _specified [feature(s)](#features-list)_ (can be comma separated list)\n\n##### `/* doiuse-enable */`\n\nRe-enables checks of _all [features](#features-list)_\n\n##### `/* doiuse-enable feature */`\n\nEnables checks of _specified [feature(s)](#features-list)_  (can be comma separated list)\n - for following lines in file\n\n## [Contributing](CONTRIBUTING.md)\n\ndoiuse is an [OPEN Open Source](http://openopensource.org/) Project.\n\nThis means that individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.\n\n## License\n\nMIT\n\n**NOTE:** Many of the files in test/cases are from autoprefixer-core, Copyright 2013 Andrey Sitnik <andrey@sitnik.ru>.  Please see https://github.com/postcss/autoprefixer-core.\n","publish_time":1765650471674,"_cnpm_publish_time":1765650471674,"dist-tags":{"latest":"6.0.6","test":"6.0.3-1"}}