mirror of
https://github.com/thangisme/notes.git
synced 2024-11-09 07:37:34 -05:00
21 lines
445 B
JavaScript
Executable File
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);
|
|
}
|