{
  "manifest": {
    "name": "csso",
    "version": "4.2.0",
    "description": "CSS minifier with structural optimisations",
    "homepage": "https://github.com/css/csso",
    "author": {
      "name": "Sergey Kryzhanovsky",
      "email": "skryzhanovsky@ya.ru",
      "url": "https://github.com/afelix"
    },
    "maintainers": [
      {
        "name": "Roman Dvornov",
        "email": "rdvornov@gmail.com"
      }
    ],
    "license": "MIT",
    "repository": {
      "type": "git",
      "url": "https://github.com/css/csso.git"
    },
    "bugs": {
      "url": "https://github.com/css/csso/issues"
    },
    "keywords": [
      "css",
      "compress",
      "minifier",
      "minify",
      "optimise",
      "optimisation",
      "csstree"
    ],
    "main": "./lib/index",
    "scripts": {
      "test": "mocha --reporter dot",
      "lint": "eslint lib test",
      "lint-and-test": "npm run lint && npm test",
      "build": "rollup --config && terser dist/csso.js --compress --mangle -o dist/csso.min.js",
      "coverage": "nyc npm test",
      "coveralls": "nyc report --reporter=text-lcov | coveralls",
      "travis": "nyc npm run lint-and-test && npm run coveralls",
      "hydrogen": "node --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces --redirect-code-traces-to=code.asm --trace_hydrogen_file=code.cfg --print-opt-code bin/csso --stat -o /dev/null",
      "prepublishOnly": "npm run build"
    },
    "dependencies": {
      "css-tree": "^1.1.2"
    },
    "browser": {
      "css-tree": "css-tree/dist/csstree.min.js"
    },
    "devDependencies": {
      "@rollup/plugin-commonjs": "^11.0.1",
      "@rollup/plugin-json": "^4.0.1",
      "@rollup/plugin-node-resolve": "^7.0.0",
      "coveralls": "^3.0.11",
      "eslint": "^6.8.0",
      "mocha": "^7.1.1",
      "nyc": "^15.0.0",
      "rollup": "^1.29.0",
      "source-map": "^0.6.1",
      "terser": "^4.6.3"
    },
    "engines": {
      "node": ">=8.0.0"
    },
    "files": [
      "dist",
      "lib"
    ],
    "_registry": "npm",
    "_loc": "/homez.1033/heliovt/.cache/yarn/v6/npm-csso-4.2.0-ea3a561346e8dc9f546d6febedd50187cf389529-integrity/node_modules/csso/package.json",
    "readmeFilename": "README.md",
    "readme": "[![NPM version](https://img.shields.io/npm/v/csso.svg)](https://www.npmjs.com/package/csso)\n[![Build Status](https://travis-ci.org/css/csso.svg?branch=master)](https://travis-ci.org/css/csso)\n[![Coverage Status](https://coveralls.io/repos/github/css/csso/badge.svg?branch=master)](https://coveralls.io/github/css/csso?branch=master)\n[![NPM Downloads](https://img.shields.io/npm/dm/csso.svg)](https://www.npmjs.com/package/csso)\n[![Twitter](https://img.shields.io/badge/Twitter-@cssoptimizer-blue.svg)](https://twitter.com/cssoptimizer)\n\nCSSO (CSS Optimizer) is a CSS minifier. It performs three sort of transformations: cleaning (removing redundant), compression (replacement for shorter form) and restructuring (merge of declarations, rulesets and so on). As a result your CSS becomes much smaller.\n\n[![Originated by Yandex](https://cdn.rawgit.com/css/csso/8d1b89211ac425909f735e7d5df87ee16c2feec6/docs/yandex.svg)](https://www.yandex.com/)\n[![Sponsored by Avito](https://cdn.rawgit.com/css/csso/8d1b89211ac425909f735e7d5df87ee16c2feec6/docs/avito.svg)](https://www.avito.ru/)\n\n## Ready to use\n\n- [Web interface](http://css.github.io/csso/csso.html)\n- [csso-cli](https://github.com/css/csso-cli) – command line interface\n- [gulp-csso](https://github.com/ben-eb/gulp-csso) – `Gulp` plugin\n- [grunt-csso](https://github.com/t32k/grunt-csso) – `Grunt` plugin\n- [broccoli-csso](https://github.com/sindresorhus/broccoli-csso) – `Broccoli` plugin\n- [postcss-csso](https://github.com/lahmatiy/postcss-csso) – `PostCSS` plugin\n- [csso-loader](https://github.com/sandark7/csso-loader) – `webpack` loader\n- [csso-webpack-plugin](https://github.com/zoobestik/csso-webpack-plugin) – `webpack` plugin\n- [CSSO Visual Studio Code plugin](https://marketplace.visualstudio.com/items?itemName=Aneryu.csso)\n\n## Install\n\n```\nnpm install csso\n```\n\n## API\n\n<!-- TOC depthfrom:3 -->\n\n- [minify(source[, options])](#minifysource-options)\n- [minifyBlock(source[, options])](#minifyblocksource-options)\n- [syntax.compress(ast[, options])](#syntaxcompressast-options)\n- [Source maps](#source-maps)\n- [Usage data](#usage-data)\n    - [White list filtering](#white-list-filtering)\n    - [Black list filtering](#black-list-filtering)\n    - [Scopes](#scopes)\n\n<!-- /TOC -->\n\nBasic usage:\n\n```js\nvar csso = require('csso');\n\nvar minifiedCss = csso.minify('.test { color: #ff0000; }').css;\n\nconsole.log(minifiedCss);\n// .test{color:red}\n```\n\nCSSO is based on [CSSTree](https://github.com/csstree/csstree) to parse CSS into AST, AST traversal and to generate AST back to CSS. All `CSSTree` API is available behind `syntax` field. You may minify CSS step by step:\n\n```js\nvar csso = require('csso');\nvar ast = csso.syntax.parse('.test { color: #ff0000; }');\nvar compressedAst = csso.syntax.compress(ast).ast;\nvar minifiedCss = csso.syntax.generate(compressedAst);\n\nconsole.log(minifiedCss);\n// .test{color:red}\n```\n\n> Warning: CSSO uses early versions of CSSTree that still in active development. CSSO doesn't guarantee API behind `syntax` field or AST format will not change in future releases of CSSO, since it's subject to change in CSSTree. Be careful with CSSO updates if you use `syntax` API until this warning removal.\n\n### minify(source[, options])\n\nMinify `source` CSS passed as `String`.\n\n```js\nvar result = csso.minify('.test { color: #ff0000; }', {\n    restructure: false,   // don't change CSS structure, i.e. don't merge declarations, rulesets etc\n    debug: true           // show additional debug information:\n                          // true or number from 1 to 3 (greater number - more details)\n});\n\nconsole.log(result.css);\n// > .test{color:red}\n```\n\nReturns an object with properties:\n\n- css `String` – resulting CSS\n- map `Object` – instance of [`SourceMapGenerator`](https://github.com/mozilla/source-map#sourcemapgenerator) or `null`\n\nOptions:\n\n- sourceMap\n\n  Type: `Boolean`  \n  Default: `false`\n\n  Generate a source map when `true`.\n\n- filename\n\n  Type: `String`  \n  Default: `'<unknown>'`\n\n  Filename of input CSS, uses for source map generation.\n\n- debug\n\n  Type: `Boolean`  \n  Default: `false`\n\n  Output debug information to `stderr`.\n\n- beforeCompress\n\n  Type: `function(ast, options)` or `Array<function(ast, options)>` or `null`  \n  Default: `null`\n\n  Called right after parse is run.\n\n- afterCompress\n\n  Type: `function(compressResult, options)` or `Array<function(compressResult, options)>` or `null`  \n  Default: `null`\n\n  Called right after [`syntax.compress()`](#syntaxcompressast-options) is run.\n\n- Other options are the same as for [`syntax.compress()`](#syntaxcompressast-options) function.\n\n### minifyBlock(source[, options])\n\nThe same as `minify()` but for list of declarations. Usually it's a `style` attribute value.\n\n```js\nvar result = csso.minifyBlock('color: rgba(255, 0, 0, 1); color: #ff0000');\n\nconsole.log(result.css);\n// > color:red\n```\n\n### syntax.compress(ast[, options])\n\nDoes the main task – compress an AST. This is CSSO's extension in CSSTree syntax API.\n\n> NOTE: `syntax.compress()` performs AST compression by transforming input AST by default (since AST cloning is expensive and needed in rare cases). Use `clone` option with truthy value in case you want to keep input AST untouched.\n\nReturns an object with properties:\n\n- ast `Object` – resulting AST\n\nOptions:\n\n- restructure\n\n  Type: `Boolean`  \n  Default: `true`\n\n  Disable or enable a structure optimisations.\n\n- forceMediaMerge\n\n  Type: `Boolean`  \n  Default: `false`\n\n  Enables merging of `@media` rules with the same media query by splitted by other rules. The optimisation is unsafe in general, but should work fine in most cases. Use it on your own risk.\n\n- clone\n\n  Type: `Boolean`  \n  Default: `false`\n\n  Transform a copy of input AST if `true`. Useful in case of AST reuse.\n\n- comments\n\n  Type: `String` or `Boolean`  \n  Default: `true`\n\n  Specify what comments to leave:\n\n  - `'exclamation'` or `true` – leave all exclamation comments (i.e. `/*! .. */`)\n  - `'first-exclamation'` – remove every comment except first one\n  - `false` – remove all comments\n\n- usage\n\n  Type: `Object` or `null`  \n  Default: `null`\n\n  Usage data for advanced optimisations (see [Usage data](#usage-data) for details)\n\n- logger\n\n  Type: `Function` or `null`  \n  Default: `null`\n\n  Function to track every step of transformation.\n\n### Source maps\n\nTo get a source map set `true` for `sourceMap` option. Additianaly `filename` option can be passed to specify source file. When `sourceMap` option is `true`, `map` field of result object will contain a [`SourceMapGenerator`](https://github.com/mozilla/source-map#sourcemapgenerator) instance. This object can be mixed with another source map or translated to string.\n\n```js\nvar csso = require('csso');\nvar css = fs.readFileSync('path/to/my.css', 'utf8');\nvar result = csso.minify(css, {\n  filename: 'path/to/my.css', // will be added to source map as reference to source file\n  sourceMap: true             // generate source map\n});\n\nconsole.log(result);\n// { css: '...minified...', map: SourceMapGenerator {} }\n\nconsole.log(result.map.toString());\n// '{ .. source map content .. }'\n```\n\nExample of generating source map with respect of source map from input CSS:\n\n```js\nvar require('source-map');\nvar csso = require('csso');\nvar inputFile = 'path/to/my.css';\nvar input = fs.readFileSync(inputFile, 'utf8');\nvar inputMap = input.match(/\\/\\*# sourceMappingURL=(\\S+)\\s*\\*\\/\\s*$/);\nvar output = csso.minify(input, {\n  filename: inputFile,\n  sourceMap: true\n});\n\n// apply input source map to output\nif (inputMap) {\n  output.map.applySourceMap(\n    new SourceMapConsumer(inputMap[1]),\n    inputFile\n  )\n}\n\n// result CSS with source map\nconsole.log(\n  output.css +\n  '/*# sourceMappingURL=data:application/json;base64,' +\n  new Buffer(output.map.toString()).toString('base64') +\n  ' */'\n);\n```\n\n### Usage data\n\n`CSSO` can use data about how `CSS` is used in a markup for better compression. File with this data (`JSON`) can be set using `usage` option. Usage data may contain following sections:\n\n- `blacklist` – a set of black lists (see [Black list filtering](#black-list-filtering))\n- `tags` – white list of tags\n- `ids` – white list of ids\n- `classes` – white list of classes\n- `scopes` – groups of classes which never used with classes from other groups on the same element\n\nAll sections are optional. Value of `tags`, `ids` and `classes` should be an array of a string, value of `scopes` should be an array of arrays of strings. Other values are ignoring.\n\n#### White list filtering\n\n`tags`, `ids` and `classes` are using on clean stage to filter selectors that contain something not in the lists. Selectors are filtering only by those kind of simple selector which white list is specified. For example, if only `tags` list is specified then type selectors are checking, and if all type selectors in selector present in list or selector has no any type selector it isn't filter.\n\n> `ids` and `classes` are case sensitive, `tags` – is not.\n\nInput CSS:\n\n```css\n* { color: green; }\nul, ol, li { color: blue; }\nUL.foo, span.bar { color: red; }\n```\n\nUsage data:\n\n```json\n{\n    \"tags\": [\"ul\", \"LI\"]\n}\n```\n\nResulting CSS:\n\n```css\n*{color:green}ul,li{color:blue}ul.foo{color:red}\n```\n\nFiltering performs for nested selectors too. `:not()` pseudos content is ignoring since the result of matching is unpredictable. Example for the same usage data as above:\n\n```css\n:nth-child(2n of ul, ol) { color: red }\n:nth-child(3n + 1 of img) { color: yellow }\n:not(div, ol, ul) { color: green }\n:has(:matches(ul, ol), ul, ol) { color: blue }\n```\n\nTurns into:\n\n```css\n:nth-child(2n of ul){color:red}:not(div,ol,ul){color:green}:has(:matches(ul),ul){color:blue}\n```\n\n#### Black list filtering\n\nBlack list filtering performs the same as white list filtering, but filters things that mentioned in the lists. `blacklist` can contain the lists `tags`, `ids` and `classes`.\n\nBlack list has a higher priority, so when something mentioned in the white list and in the black list then white list occurrence is ignoring. The `:not()` pseudos content ignoring as well.\n\n```css\n* { color: green; }\nul, ol, li { color: blue; }\nUL.foo, li.bar { color: red; }\n```\n\nUsage data:\n\n```json\n{\n    \"blacklist\": {\n        \"tags\": [\"ul\"]\n    },\n    \"tags\": [\"ul\", \"LI\"]\n}\n```\n\nResulting CSS:\n\n```css\n*{color:green}li{color:blue}li.bar{color:red}\n```\n\n#### Scopes\n\nScopes is designed for CSS scope isolation solutions such as [css-modules](https://github.com/css-modules/css-modules). Scopes are similar to namespaces and define lists of class names that exclusively used on some markup. This information allows the optimizer to move rules more agressive. Since it assumes selectors from different scopes don't match for the same element. This can improve rule merging.\n\nSuppose we have a file:\n\n```css\n.module1-foo { color: red; }\n.module1-bar { font-size: 1.5em; background: yellow; }\n\n.module2-baz { color: red; }\n.module2-qux { font-size: 1.5em; background: yellow; width: 50px; }\n```\n\nIt can be assumed that first two rules are never used with the second two on the same markup. But we can't say that for sure without a markup review. The optimizer doesn't know it either and will perform safe transformations only. The result will be the same as input but with no spaces and some semicolons:\n\n```css\n.module1-foo{color:red}.module1-bar{font-size:1.5em;background:#ff0}.module2-baz{color:red}.module2-qux{font-size:1.5em;background:#ff0;width:50px}\n```\n\nWith usage data `CSSO` can produce better output. If follow usage data is provided:\n\n```json\n{\n    \"scopes\": [\n        [\"module1-foo\", \"module1-bar\"],\n        [\"module2-baz\", \"module2-qux\"]\n    ]\n}\n```\n\nThe result will be (29 bytes extra saving):\n\n```css\n.module1-foo,.module2-baz{color:red}.module1-bar,.module2-qux{font-size:1.5em;background:#ff0}.module2-qux{width:50px}\n```\n\nIf class name isn't mentioned in the `scopes` it belongs to default scope. `scopes` data doesn't affect `classes` whitelist. If class name mentioned in `scopes` but missed in `classes` (both sections are specified) it will be filtered.\n\nNote that class name can't be set for several scopes. Also a selector can't have class names from different scopes. In both cases an exception will thrown.\n\nCurrently the optimizer doesn't care about changing order safety for out-of-bounds selectors (i.e. selectors that match to elements without class name, e.g. `.scope div` or `.scope ~ :last-child`). It assumes that scoped CSS modules doesn't relay on it's order. It may be fix in future if to be an issue.\n",
    "licenseText": "Copyright (C) 2015-2019 by Roman Dvornov\nCopyright (C) 2011-2015 by Sergey Kryzhanovsky\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  "artifacts": [],
  "remote": {
    "resolved": "https://registry.yarnpkg.com/csso/-/csso-4.2.0.tgz#ea3a561346e8dc9f546d6febedd50187cf389529",
    "type": "tarball",
    "reference": "https://registry.yarnpkg.com/csso/-/csso-4.2.0.tgz",
    "hash": "ea3a561346e8dc9f546d6febedd50187cf389529",
    "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==",
    "registry": "npm",
    "packageName": "csso",
    "cacheIntegrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA== sha1-6jpWE0bo3J9UbW/r7dUBh884lSk="
  },
  "registry": "npm",
  "hash": "ea3a561346e8dc9f546d6febedd50187cf389529"
}