{"name":"doiuse","version":"6.0.5","keywords":["lint","css","browser","support","caniuse","stylelint"],"author":{"url":"https://github.com/clshortfuse","name":"Carlos Lopez Jr.","email":"clshortfuse@gmail.com"},"license":"MIT","_id":"doiuse@6.0.5","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"}],"contributors":[{"url":"https://github.com/RJWadley","name":"Robbie Wadley"},{"url":"http://www.anandthakker.net/","name":"Anand Thakker","email":"mail@anandthakker.net"},{"url":"https://github.com/pkuczynski","name":"Piotr Kuczynski","email":"piotr.kuczynski@gmail.com"}],"homepage":"https://github.com/anandthakker/doiuse","bugs":{"url":"https://github.com/anandthakker/doiuse/issues"},"bin":{"doiuse":"bin/cli.js"},"tap":{"disable-coverage":true},"dist":{"shasum":"de24707721f879b488f67dc9f72761c5b5203d30","tarball":"http://registry-npm.ywwl.com/doiuse/download/doiuse-6.0.5.tgz","fileCount":676,"integrity":"sha512-ljuf9ndGqKST0GlPAYyCg04hbQAeR1xIIWVDjQaDDkoTY/Y1Vb+8FNoy6NuVuJIEEKe/nKUH8NRWjG7JJxZ9Eg==","signatures":[{"sig":"MEUCIQDGy7QJ455awdnOMdzy1qN3ID+AsAO2qaTcVAR8adgd5QIgSW/VGyChlnx7gkepbrUPBD0w4YerEzZIJupQEPPX61E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":390979,"size":102190,"noattachment":false,"key":"/doiuse/-/doiuse-6.0.5.tgz"},"type":"module","main:":"./exports/index.cjs","engines":{"node":">=16"},"exports":{".":{"import":"./exports/index.js","require":"./exports/index.cjs"},"./lib/*":"./lib/*","./stream":{"import":"./exports/stream.js","require":"./exports/stream.cjs"}},"gitHead":"720178919c74293f34dc4e244f763b876470f801","scripts":{"test":"c8 tap test/**/*.js","prepare":"rollup -c rollup.config.js","pretest":"eslint \"./bin/**/*.js\" \"./data/**/*.js\" \"./utils/**/*.js\" \"./lib/**/*.js\" \"./test/**/*.js\" && tsc --noEmit","prepublishOnly":"tsc --emitDeclarationOnly","updateFeatures":"scripts/update-caniuse.sh && node scripts/update-features.js"},"_npmUser":{"name":"shortfuse","email":"clshortfuse@gmail.com"},"repository":{"url":"git+https://github.com/anandthakker/doiuse.git","type":"git"},"_npmVersion":"10.5.0","description":"Lint CSS for browser support against caniuse database","directories":{},"_nodeVersion":"20.12.2","dependencies":{"yargs":"^17.7.2","postcss":"^8.4.47","duplexify":"^4.1.3","multimatch":"^5.0.0","source-map":"^0.7.4","browserslist":"^4.24.0","caniuse-lite":"^1.0.30001669","css-tokenize":"^1.0.1"},"typesVersions":{"*":{"*":["types/*"]}},"_hasShrinkwrap":false,"devDependencies":{"c8":"^7.14.0","tap":"^18.8.0","eslint":"^8.57.1","rollup":"^2.79.2","mock-fs":"^4.14.0","@types/tap":"^15.0.12","caniuse-db":"^1.0.30001669","safe-regex":"^2.1.1","typescript":"^5.6.3","@types/node":"^16.18.114","@types/yargs":"^17.0.33","postcss-import":"^14.1.0","eslint-plugin-n":"^16.6.2","@types/duplexify":"^3.6.4","@types/caniuse-lite":"^1.0.5","eslint-plugin-jsdoc":"^46.10.1","eslint-plugin-import":"^2.31.0","eslint-plugin-unicorn":"^47.0.0","eslint-plugin-canonical":"^4.18.1","@typescript-eslint/parser":"^5.62.0","eslint-config-airbnb-base":"^15.0.0","@typescript-eslint/eslint-plugin":"^5.62.0"},"_npmOperationalInternal":{"tmp":"tmp/doiuse_6.0.5_1729520247328_0.3511684672246138","host":"s3://npm-registry-packages"},"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":1729520247608,"_cnpm_publish_time":1729520247608,"dist-tags":{"latest":"6.0.6","test":"6.0.3-1"}}