Skip to content

Instantly share code, notes, and snippets.

@neowulf
Created January 31, 2014 22:35
Show Gist options
  • Save neowulf/8744656 to your computer and use it in GitHub Desktop.
Save neowulf/8744656 to your computer and use it in GitHub Desktop.
NodeJS Scripts
#!/usr/bin/env node
"use strict";
var fs = require('fs');
var path = require('path');
var es_stats_file = path.resolve(__dirname, 'file.json');
console.log("Reading: " + es_stats_file);
fs.readFile(es_stats_file, function (err, data) {
if (err) throw err;
var json = JSON.parse(data);
console.log(json);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment