postcss-cli
Advanced tools
Comparing version 0.1.0 to 0.2.0
0.2.0 / 2015-03-13 | ||
================== | ||
* use autoprefixer instead of autoprefixer-core | ||
* change short options for --use from `p` to `u` | ||
* add -v|--version support | ||
* add --safe option to enable postcss safe mode | ||
0.1.0 / 2015-03-11 | ||
@@ -3,0 +11,0 @@ ================== |
22
index.js
var argv = require("yargs") | ||
.usage('Usage: $0 -use|-p plugin [--config|-c config.json] --output|-o output.css input.css') | ||
.example('postcss --use autoprefixer-core -c options.json -o screen.css screen.css', | ||
.example('postcss --use autoprefixer -c options.json -o screen.css screen.css', | ||
'Use autoprefixer as a postcss plugin') | ||
.example('postcss --use autoprefixer-core --autoprefixer-code.browsers "> 5%" -o screen.css screen.css', | ||
.example('postcss --use autoprefixer --autoprefixer.browsers "> 5%" -o screen.css screen.css', | ||
'Pass plugin parameters in plugin.option notation') | ||
@@ -11,9 +11,18 @@ .demand(1, 'Please specify input file.') | ||
.describe('c', 'JSON file with plugin configuration') | ||
.alias('p', 'use') | ||
.describe('p', 'postcss plugin name (can be used multiple times)') | ||
.demand('p', 'Please specify at least one plugin name.') | ||
.alias('u', 'use') | ||
.describe('u', 'postcss plugin name (can be used multiple times)') | ||
.demand('u', 'Please specify at least one plugin name.') | ||
.alias('o', 'output') | ||
.describe('o', 'Output file') | ||
.demand('o', 'Please specify output file.') | ||
.requiresArg(['p', 'c', 'o']) | ||
.requiresArg(['u', 'c', 'o']) | ||
.boolean('safe') | ||
.describe('safe', 'Enable postcss safe mode.') | ||
.version(function() { | ||
return [ | ||
'postcss version', | ||
require('./node_modules/postcss/package.json').version | ||
].join(' ') | ||
}, 'v') | ||
.alias('v', 'version') | ||
.help('h') | ||
@@ -50,2 +59,3 @@ .alias('h', 'help') | ||
var result = processor.process(css, { | ||
safe: argv.safe, | ||
from: input, | ||
@@ -52,0 +62,0 @@ to: output |
{ | ||
"name": "postcss-cli", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "CLI for postcss", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -13,7 +13,7 @@ # postcss-cli | ||
#### `-o, --output` | ||
#### `--output|-o` | ||
Output file name - required | ||
#### `--use|-p` | ||
#### `--use|-u` | ||
@@ -28,3 +28,3 @@ Plugin to be used. Multiple plugins can be specified. At least one is required. | ||
{ | ||
"autoprefixer-core": { | ||
"autoprefixer": { | ||
"browsers": "> 5%" | ||
@@ -40,2 +40,6 @@ }, | ||
### `--safe` | ||
Enable Safe Mode, in which PostCSS will try to fix CSS syntax errors. | ||
#### `-h, --help` | ||
@@ -49,7 +53,7 @@ | ||
postcss --use autoprefixer-core -c options.json -o screen.css screen.css | ||
postcss --use autoprefixer -c options.json -o screen.css screen.css | ||
Use more than one plugin and pass config parameters | ||
postcss --use autoprefixer-core --autoprefixer-code.browsers "> 5%" \ | ||
postcss --use autoprefixer --autoprefixer.browsers "> 5%" \ | ||
--use postcss-cachify --postcss-cachify.baseUrl /res \ | ||
@@ -62,2 +66,2 @@ -o screen.css screen.css | ||
[postcss]: https://github.com/postcss/postcss | ||
[postcss]: https://github.com/postcss/postcss |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4436
13
77
63