{"_id":"@0xradical/postcss-cli","name":"@0xradical/postcss-cli","dist-tags":{"latest":"10.0.0"},"versions":{"10.0.0":{"name":"@0xradical/postcss-cli","version":"10.0.0","description":"CLI for PostCSS","type":"module","engines":{"node":">=14"},"bin":{"postcss":"index.js"},"scripts":{"ci":"eslint . && c8 ava -v && npm run prettier -- --list-different","clean":"node test/helpers/clean.js","prettier":"prettier --single-quote --no-semi \"**/*.{js,md}\"","format":"npm run prettier -- --write && eslint . --fix","pretest":"npm run clean && npm run format","test":"c8 ava -v"},"dependencies":{"chokidar":"^3.3.0","dependency-graph":"^0.11.0","fs-extra":"^10.0.0","get-stdin":"^9.0.0","globby":"^13.0.0","picocolors":"^1.0.0","postcss-load-config":"^4.0.0","postcss-reporter":"^7.0.0","pretty-hrtime":"^1.0.3","read-cache":"^1.0.0","slash":"^5.0.0","yargs":"^17.0.0"},"devDependencies":{"ava":"^3.1.0","c8":"^7.9.0","coveralls":"^3.0.0","eslint":"^8.2.0","eslint-config-problems":"7.0.1","postcss":"^8.0.4","postcss-import":"^15.0.0","prettier":"~2.8.0","sugarss":"^4.0.0","uuid":"^9.0.0"},"peerDependencies":{"postcss":"^8.0.0"},"keywords":["cli","postcss","postcss-runner"],"contributors":[{"name":"Michael Ciniawky","email":"michael.ciniawsky@gmail.com"},{"name":"Ryan Zimmermann","email":"opensrc@ryanzim.com"}],"repository":{"type":"git","url":"git+https://github.com/postcss/postcss-cli.git"},"bugs":{"url":"https://github.com/postcss/postcss-cli/issues"},"homepage":"https://github.com/postcss/postcss-cli#readme","license":"MIT","gitHead":"c58170c751d019f269a5439b7b157212f11258c6","_id":"@0xradical/postcss-cli@10.0.0","_nodeVersion":"18.7.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-C4IGUVXxn9Nw4fzeVk1uSEUKGU2DT7Fl8Y1Sz/GsxgaMmXQqoqlszibZTGthaoIfCmxGaCqBjxWl6OhTS5rT8g==","shasum":"f6dfd0dbd888b8128be9519afab5a60647f2edb7","tarball":"https://registry.npmjs.org/@0xradical/postcss-cli/-/postcss-cli-10.0.0.tgz","fileCount":7,"unpackedSize":22628,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCM2LGEs6Jcm/F5FYgFKx7HlqwwEVntdmbLzR2ludoQOAIgXjWDtUoRL4imnzeLCuQJ6sEXRrr6skASs1AFsZjiwvo="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhPEQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmos1g//WWAK4ZbnagjwbDByE03e7XZyNg4oQnpz4NfHP7f/ysjYYilP\r\n+xie0Tb6yOkkVz41ZczQfk6ReDalMc/r/Ss6OXFCbaVk99dsjd7WNJUbCf1c\r\n6M16tbpH2OqqK3EhEPBmQboNhW1466KbY6YhzwhCstbsAlxlSS3iH1yogQZL\r\nXaRdvaiaAxtIVihAEBA6zOm5LIbQCVFo2eOepeb5epzvVMaIF6B5b4aOqmVW\r\nscYefE6zFRilxkKw7G/YnwZXfcy6bmuGQI71LzqVtWxJhi0ynP6vqOl4nF4s\r\nNs+aOPGRGBDI9YfKz7a5mLx47dhJLP1en6GSQJzoeCsFVNuC4ztVSoOQ+bF8\r\nRUEsoxNit/GYsd8GKnwRi8XEEJO8TkHndv6nq1Fv+vqGONCbdSaK73msDkKz\r\nt9nk6bezXikSucxxxatzhCF7BIUdtWuHlnhND7D4KwvkqpYJTzcx5qArUgZ5\r\n6H+JNQI2vrqxp5hsRbYM6VtivQsM5DzNKtn3kxqOMgM2G3oBNJhiHzSFLx36\r\n6ojtALzdAqkZbxa3z+5JP06LYOoT1UNrwUDyUOPGvQOah0okM3ZRtOM1ULgc\r\nU6V/2K8sUDukjfg8s75n3FcdkD5t7oYsl6jFfAIZtILEEyWxUK8rc4waso8T\r\nUmv7YLGKZf3B6KEMdFtSsoHWMTOG7Gu3xHw=\r\n=3lvZ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"0xradical","email":"contact@0xradical.com"},"directories":{},"maintainers":[{"name":"0xradical","email":"contact@0xradical.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postcss-cli_10.0.0_1669656848049_0.6177519770794131"},"_hasShrinkwrap":false}},"time":{"created":"2022-11-28T17:34:07.993Z","10.0.0":"2022-11-28T17:34:08.194Z","modified":"2022-11-28T17:34:08.332Z"},"maintainers":[{"name":"0xradical","email":"contact@0xradical.com"}],"description":"CLI for PostCSS","homepage":"https://github.com/postcss/postcss-cli#readme","keywords":["cli","postcss","postcss-runner"],"repository":{"type":"git","url":"git+https://github.com/postcss/postcss-cli.git"},"contributors":[{"name":"Michael Ciniawky","email":"michael.ciniawsky@gmail.com"},{"name":"Ryan Zimmermann","email":"opensrc@ryanzim.com"}],"bugs":{"url":"https://github.com/postcss/postcss-cli/issues"},"license":"MIT","readme":"[![npm][npm]][npm-url]\n[![node][node]][node-url]\n[![tests][tests]][tests-url]\n[![cover][cover]][cover-url]\n[![chat][chat]][chat-url]\n\n<div align=\"center\">\n  <img width=\"100\" height=\"100\" title=\"CLI\" src=\"https://raw.githubusercontent.com/postcss/postcss-cli/HEAD/logo.svg\">\n  <a href=\"https://github.com/postcss/postcss\">\n    <img width=\"110\" height=\"110\" title=\"PostCSS\" src=\"http://postcss.github.io/postcss/logo.svg\" hspace=\"10\">\n  </a>\n  <h1>PostCSS CLI</h1>\n</div>\n\n<h2 align=\"center\">Install</h2>\n\n```bash\nnpm i -D postcss postcss-cli\n```\n\n<h2 align=\"center\">Usage</h2>\n\n```\nUsage:\n  postcss [input.css] [OPTIONS] [-o|--output output.css] [--watch|-w]\n  postcss <input.css>... [OPTIONS] --dir <output-directory> [--watch|-w]\n  postcss <input-directory> [OPTIONS] --dir <output-directory> [--watch|-w]\n  postcss <input-glob-pattern> [OPTIONS] --dir <output-directory> [--watch|-w]\n  postcss <input.css>... [OPTIONS] --replace\n\nBasic options:\n  -o, --output   Output file                                            [string]\n  -d, --dir      Output directory                                       [string]\n  -r, --replace  Replace (overwrite) the input file                    [boolean]\n  -m, --map      Create an external sourcemap\n  --no-map       Disable the default inline sourcemaps\n  -w, --watch    Watch files for changes and recompile as needed       [boolean]\n  --verbose      Be verbose                                            [boolean]\n  --env          A shortcut for setting NODE_ENV                        [string]\n\nOptions for use without a config file:\n  -u, --use      List of postcss plugins to use                          [array]\n  --parser       Custom postcss parser                                  [string]\n  --stringifier  Custom postcss stringifier                             [string]\n  --syntax       Custom postcss syntax                                  [string]\n\nOptions for use with --dir:\n  --ext   Override the output file extension; for use with --dir        [string]\n  --base  Mirror the directory structure relative to this path in the output\n          directory, for use with --dir                                 [string]\n\nAdvanced options:\n  --include-dotfiles  Enable glob to match files/dirs that begin with \".\"\n                                                                       [boolean]\n  --poll              Use polling for file watching. Can optionally pass polling\n                      interval; default 100 ms\n  --config            Set a custom directory to look for a config file  [string]\n\nOptions:\n  --version   Show version number                                      [boolean]\n  -h, --help  Show help                                                [boolean]\n\nExamples:\n  postcss input.css -o output.css                       Basic usage\n  postcss src/**/*.css --base src --dir build           Glob Pattern & output\n  cat input.css | postcss -u autoprefixer > output.css  Piping input & output\n\nIf no input files are passed, it reads from stdin. If neither -o, --dir, or\n--replace is passed, it writes to stdout.\n\nIf there are multiple input files, the --dir or --replace option must be passed.\n\nInput files may contain globs (e.g. src/**/*.css). If you pass an input\ndirectory, it will process all files in the directory and any subdirectories,\nrespecting the glob pattern.\n```\n\n> ℹ️ More details on custom parsers, stringifiers and syntaxes, can be found [here](https://github.com/postcss/postcss#syntaxes).\n\n### [Config](https://github.com/michael-ciniawsky/postcss-load-config)\n\nIf you need to pass options to your plugins, or have a long plugin chain, you'll want to use a configuration file.\n\n**postcss.config.js**\n\n```js\nmodule.exports = {\n  parser: 'sugarss',\n  plugins: [\n    require('postcss-import')({ ...options }),\n    require('postcss-url')({ url: 'copy', useHash: true }),\n  ],\n}\n```\n\nNote that you **can not** set the `from` or `to` options for postcss in the config file. They are set automatically based on the CLI arguments.\n\n### Context\n\nFor more advanced usage, it's recommended to use a function in `postcss.config.js`; this gives you access to the CLI context to dynamically apply options and plugins **per file**\n\n|   Name    |    Type    |              Default               | Description          |\n| :-------: | :--------: | :--------------------------------: | :------------------- |\n|   `env`   | `{String}` |          `'development'`           | process.env.NODE_ENV |\n|  `file`   | `{Object}` |    `dirname, basename, extname`    | File                 |\n| `options` | `{Object}` | `map, parser, syntax, stringifier` | PostCSS Options      |\n\n**postcss.config.js**\n\n```js\nmodule.exports = (ctx) => ({\n  map: ctx.options.map,\n  parser: ctx.file.extname === '.sss' ? 'sugarss' : false,\n  plugins: {\n    'postcss-import': { root: ctx.file.dirname },\n    cssnano: ctx.env === 'production' ? {} : false,\n  },\n})\n```\n\n> ⚠️ If you want to set options via CLI, it's mandatory to reference `ctx.options` in `postcss.config.js`\n\n```bash\npostcss input.sss -p sugarss -o output.css -m\n```\n\n**postcss.config.js**\n\n```js\nmodule.exports = (ctx) => ({\n  map: ctx.options.map,\n  parser: ctx.options.parser,\n  plugins: {\n    'postcss-import': { root: ctx.file.dirname },\n    cssnano: ctx.env === 'production' ? {} : false,\n  },\n})\n```\n\n[npm]: https://img.shields.io/npm/v/postcss-cli.svg\n[npm-url]: https://npmjs.com/package/postcss-cli\n[node]: https://img.shields.io/node/v/postcss-cli.svg\n[node-url]: https://nodejs.org/\n[tests]: https://img.shields.io/github/workflow/status/postcss/postcss-cli/Node.js%20CI/master\n[tests-url]: https://github.com/postcss/postcss-cli/actions?query=branch%3Amaster\n[cover]: https://img.shields.io/coveralls/postcss/postcss-cli/master.svg\n[cover-url]: https://coveralls.io/github/postcss/postcss-cli\n[chat]: https://img.shields.io/gitter/room/postcss/postcss.svg\n[chat-url]: https://gitter.im/postcss/postcss\n","readmeFilename":"README.md"}