1
0
mirror of synced 2025-12-15 18:58:18 +08:00

change sys module to util

This commit is contained in:
Zach Carter
2011-11-21 20:19:34 -05:00
parent 1ff64514b6
commit 5a52ba4662
3 changed files with 11 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env node
var sys = require("sys");
var util = require("util");
var fs = require("fs");
var parser = require("./jsonlint").parser;
var options = require("nomnom")
@@ -41,7 +41,7 @@ function parse (source) {
parser.parse(source);
return JSON.stringify(parsed,null,options.indent);
} catch (e) {
sys.puts(e);
util.puts(e);
process.exit(1);
}
}
@@ -54,7 +54,7 @@ function main (args) {
if (options.inplace) {
fs.writeSync(fs.openSync(path,'w+'), source, 0, "utf8");
} else {
sys.puts(source);
util.puts(source);
}
} else {
var stdin = process.openStdin();
@@ -64,7 +64,7 @@ function main (args) {
source += chunk.toString('utf8');
});
stdin.on('end', function () {
sys.puts(parse(source));
util.puts(parse(source));
});
}
}