Comparing version 0.2.2 to 0.2.3
{ | ||
"name": "doiuse", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Lint CSS for browser support against caniuse database.", | ||
@@ -30,2 +30,3 @@ "main": "dist/index.js", | ||
"concat-stream": "^1.4.6", | ||
"css-rule-stream": "^1.0.0", | ||
"duplexer2": "0.0.2", | ||
@@ -32,0 +33,0 @@ "jsonfilter": "^1.1.2", |
var through = require('through2'), | ||
duplexer = require('duplexer2'), | ||
concat = require('concat-stream'); | ||
rules = require('css-rule-stream'); | ||
@@ -12,18 +12,17 @@ var postcss = require('postcss'), | ||
function stream(browsers) { | ||
var out = through.obj(); | ||
var inp = concat({encoding: 'string'}, function(css) { | ||
var inp = rules(); | ||
var out = through.obj(function(rule, enc, next) { | ||
try { | ||
postcss(doiuse({ | ||
browserSelection: browsers, | ||
onUnsupportedFeatureUse: out.write.bind(out) | ||
})).process(css); | ||
onUnsupportedFeatureUse: this.push.bind(this) | ||
})).process(rule.content); | ||
} | ||
catch(e) { | ||
out.write({"message": "error parsing CSS", "error": e}); | ||
next(e); | ||
} | ||
finally { | ||
out.end(); | ||
} | ||
}); | ||
inp.pipe(out); | ||
return duplexer(inp, out); | ||
} |
@@ -34,2 +34,3 @@ | ||
exec(cmd,function(error, stdout, stderr) { | ||
console.log('CLI output:', stdout); | ||
JSON.parse(stdout).feature.should.be.equal('css-resize') | ||
@@ -36,0 +37,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
61502
10
70
1165
+ Addedcss-rule-stream@^1.0.0
+ Addedcss-rule-stream@1.1.0(transitive)
+ Addedcss-tokenize@1.0.1(transitive)