1. Nikhil Marathe
  2. yajl-js

Commits

Nikhil Marathe  committed e897b65

Updated to work with latest node, and the stream event listeners

  • Participants
  • Parent commits 90ca2d8
  • Branches default

Comments (0)

Files changed (1)

File test.js

View file
  • Ignore whitespace
 // Will be a complete reformatter in javascript similar to the Yajl reformatter
 var sys = require('sys');
-var posix = require('posix');
 var yajl = require('./src/yajl');
 
 function usage() {
 
 var handle = yajl.createHandle();
 handle.addListener( "null", function() {
-    sys.debug("Nullify");
+    sys.debug("null");
 });
 
 handle.addListener( "boolean", function(b) {
 
 var done = false;
 
-process.stdio.open();
-process.stdio.addListener( "data", function( data ) {
-    handle.parse(data);
+stdin = process.openStdin();
+stdin.addListener( "data", function( data ) {
+    handle.parse(data.toString());
 });
-process.stdio.addListener( "close", function() {
+stdin.addListener( "end", function() {
     handle.parseComplete();
 });