gulp-pxtorem
Advanced tools
Comparing version
15
index.js
@@ -1,7 +0,12 @@ | ||
var gutil = require('gulp-util'); | ||
'use strict'; | ||
var gutil = require('gulp-util'); | ||
var through = require('through2'); | ||
var postcss = require('postcss'); | ||
var pxtorem = require('pxtorem'); | ||
var pxtorem = require('postcss-pxtorem'); | ||
var PLUGIN_NAME = 'gulp-pxtorem'; | ||
module.exports = function (options, postcssOptions) { | ||
return through.obj(function(file, enc, cb) { | ||
@@ -14,3 +19,3 @@ if (file.isNull()) { | ||
if (file.isStream()) { | ||
this.emit('error', new gutil.PluginError('gulp-pxtorem', 'Streaming not supported')); | ||
this.emit('error', new gutil.PluginError(PLUGIN_NAME, 'Streaming not supported')); | ||
return cb(); | ||
@@ -22,3 +27,3 @@ } | ||
} catch (err) { | ||
this.emit('error', new gutil.PluginError('gulp-pxtorem', err)); | ||
this.emit('error', new gutil.PluginError(PLUGIN_NAME, err)); | ||
} | ||
@@ -29,2 +34,2 @@ | ||
}); | ||
}; | ||
}; |
{ | ||
"name": "gulp-pxtorem", | ||
"description": "A gulp plugin for pxtorem", | ||
"version": "0.1.0", | ||
"author": "Jonathan Cuthbert <jon@cuth.net> (http://cuth.net)", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/cuth/gulp-pxtorem" | ||
}, | ||
"bugs": "https://github.com/cuth/gulp-pxtorem/issues", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "mocha" | ||
}, | ||
"dependencies": { | ||
"postcss": "^2.1.0", | ||
"pxtorem": "^1.0.0", | ||
"through2": "~0.5.1", | ||
"gulp-util": "~2.2.19" | ||
}, | ||
"keywords": [ | ||
"css", | ||
"parser", | ||
"postproccessor", | ||
"rem", | ||
"gulp" | ||
] | ||
} | ||
"name": "gulp-pxtorem", | ||
"description": "A gulp plugin for postcss-pxtorem", | ||
"version": "1.0.0", | ||
"author": "Jonathan Cuthbert <jon@cuth.net> (http://cuth.net)", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/cuth/gulp-pxtorem" | ||
}, | ||
"bugs": "https://github.com/cuth/gulp-pxtorem/issues", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "mocha" | ||
}, | ||
"dependencies": { | ||
"gulp-util": "^3.0.3", | ||
"postcss": "^4.0.3", | ||
"postcss-pxtorem": "^2.0.1", | ||
"through2": "^0.6.3" | ||
}, | ||
"keywords": [ | ||
"css", | ||
"parser", | ||
"postproccessor", | ||
"rem", | ||
"gulp", | ||
"gulpplugin" | ||
], | ||
"devDependencies": { | ||
"gulp-sourcemaps": "^1.1.1" | ||
} | ||
} |
# gulp-pxtorem [](http://badge.fury.io/js/gulp-pxtorem) | ||
This is a Gulp plugin for [pxtorem](https://github.com/cuth/pxtorem). | ||
This is a Gulp plugin for [postcss-pxtorem](https://github.com/cuth/postcss-pxtorem). | ||
@@ -25,6 +25,6 @@ ### Installation | ||
Pass in two option objects. The first one for [pxtorem](https://github.com/cuth/pxtorem) options, the second for [postcss](https://github.com/postcss/postcss) options. | ||
Pass in two option objects. The first one for [postcss-pxtorem](https://github.com/cuth/postcss-pxtorem) options, the second for [postcss](https://github.com/postcss/postcss) options. | ||
```js | ||
var pxtorem = require('gulp-pixrem'); | ||
var pxtorem = require('gulp-pxtorem'); | ||
@@ -44,2 +44,2 @@ var pxtoremOptions = { | ||
}); | ||
``` | ||
``` |
12
test.js
@@ -1,5 +0,5 @@ | ||
/* | ||
/** | ||
* To test install mocha: | ||
* npm install -g mocha | ||
* | ||
* | ||
* Run mocha: | ||
@@ -9,2 +9,4 @@ * mocha | ||
'use strict'; | ||
var assert = require('assert'); | ||
@@ -15,3 +17,3 @@ var gutil = require('gulp-util'); | ||
describe('gulp-pixrem', function() { | ||
it('should postprocess CSS using Pxtorem with the default pixel root value', function(done) { | ||
it('should postprocess CSS using gulp-pxtorem with the default pixel root value', function(done) { | ||
var stream = pxtorem(); | ||
@@ -29,3 +31,3 @@ | ||
it('should postprocess CSS using Pxtorem with a custom pixel root value', function(done) { | ||
it('should postprocess CSS using gulp-pxtorem with a custom pixel root value', function(done) { | ||
var stream = pxtorem({ | ||
@@ -44,2 +46,2 @@ root_value: 10 | ||
}); | ||
}); | ||
}); |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
5266
6.56%9
12.5%60
9.09%1
-50%44
2.33%1
Infinity%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated