File tree 2 files changed +20
-0
lines changed
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ var lexer = new Lexer();
4
4
var parser = new Parser ( ) ;
5
5
var generator = new Generator ( ) ;
6
6
7
+ var Jsonify = require ( './jsonify' ) ;
8
+ var jsonify = new Jsonify ( ) ;
9
+
10
+ // lexer.pipe(jsonify).pipe(process.stderr);
11
+ // parser.pipe(jsonify).pipe(process.stderr);
12
+
7
13
process . stdin
8
14
. pipe ( lexer )
9
15
. pipe ( parser )
Original file line number Diff line number Diff line change
1
+ module . exports = Debug ;
2
+ var util = require ( 'util' ) , stream = require ( 'stream' ) ;
3
+ util . inherits ( module . exports , stream . Transform ) ;
4
+ function Debug ( options ) {
5
+ stream . Transform . call ( this , options ) ;
6
+ this . _writableState . objectMode = true ;
7
+ this . _readableState . objectMode = false ;
8
+ }
9
+ Debug . prototype . _transform = function ( chunk , encoding , cb ) {
10
+ this . push ( JSON . stringify ( chunk , null , '\t' ) ) ;
11
+ this . push ( '\n' ) ;
12
+ cb ( ) ;
13
+ } ;
14
+
You can’t perform that action at this time.
0 commit comments