1
0
mirror of https://github.com/thangisme/notes.git synced 2024-12-22 14:56:26 -05:00
notes/node_modules/css-rule-stream/index.js
Patrick Marsceill b7b0d0d7bf
Initial commit
2017-03-09 13:16:08 -05:00

21 lines
445 B
JavaScript
Executable File

#!/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);
}