1
0
mirror of https://github.com/thangisme/notes.git synced 2024-11-01 00:37:33 -04:00
notes/node_modules/css-rule-stream/index.js

21 lines
445 B
JavaScript
Raw Normal View History

2017-03-09 13:16:08 -05:00
#!/usr/bin/env node
var tokenize = require('css-tokenize'),
duplexer = require('duplexer2'),
ldjson = require('ldjson-stream'),
match = require('./lib/match');
module.exports = ruleStream;
function ruleStream() {
var tokens = tokenize(), rules = match();
tokens.pipe(rules);
return duplexer(tokens, rules);
}
if(require.main === module) {
process.stdin.pipe(ruleStream())
.pipe(ldjson.serialize())
.pipe(process.stdout);
}