change sys module to util
This commit is contained in:
4
Makefile
4
Makefile
@@ -6,6 +6,10 @@ build:
|
|||||||
mv jsonlint.js lib/jsonlint.js
|
mv jsonlint.js lib/jsonlint.js
|
||||||
node scripts/bundle.js | uglifyjs > web/jsonlint.js
|
node scripts/bundle.js | uglifyjs > web/jsonlint.js
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
cp web/jsonlint.js ../jsonlint-pages/jsonlint.js
|
||||||
|
cd ../jsolint-pages && git commit -a -m 'deploy site updates' && git push origin gh-pages
|
||||||
|
|
||||||
test: lib/jsonlint.js test/all-tests.js
|
test: lib/jsonlint.js test/all-tests.js
|
||||||
node test/all-tests.js
|
node test/all-tests.js
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
var sys = require("sys");
|
var util = require("util");
|
||||||
var fs = require("fs");
|
var fs = require("fs");
|
||||||
var parser = require("./jsonlint").parser;
|
var parser = require("./jsonlint").parser;
|
||||||
var options = require("nomnom")
|
var options = require("nomnom")
|
||||||
@@ -41,7 +41,7 @@ function parse (source) {
|
|||||||
parser.parse(source);
|
parser.parse(source);
|
||||||
return JSON.stringify(parsed,null,options.indent);
|
return JSON.stringify(parsed,null,options.indent);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
sys.puts(e);
|
util.puts(e);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,7 @@ function main (args) {
|
|||||||
if (options.inplace) {
|
if (options.inplace) {
|
||||||
fs.writeSync(fs.openSync(path,'w+'), source, 0, "utf8");
|
fs.writeSync(fs.openSync(path,'w+'), source, 0, "utf8");
|
||||||
} else {
|
} else {
|
||||||
sys.puts(source);
|
util.puts(source);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var stdin = process.openStdin();
|
var stdin = process.openStdin();
|
||||||
@@ -64,7 +64,7 @@ function main (args) {
|
|||||||
source += chunk.toString('utf8');
|
source += chunk.toString('utf8');
|
||||||
});
|
});
|
||||||
stdin.on('end', function () {
|
stdin.on('end', function () {
|
||||||
sys.puts(parse(source));
|
util.puts(parse(source));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"lint",
|
"lint",
|
||||||
"jsonlint"
|
"jsonlint"
|
||||||
],
|
],
|
||||||
"version": "1.2.0",
|
"version": "1.2.1",
|
||||||
"preferGlobal": true,
|
"preferGlobal": true,
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
"jsonlint": "lib/cli.js"
|
"jsonlint": "lib/cli.js"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "0.4 || 0.5 || 0.6"
|
"node": ">= 0.6"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"nomnom": ">= 0.4.3"
|
"nomnom": ">= 0.4.3"
|
||||||
|
|||||||
Reference in New Issue
Block a user