From c7b98d37cd529c8254a2e3641a108e798cb19927 Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Thu, 21 Jan 2016 19:53:33 -0500 Subject: [PATCH] read in file from command line, spit it out --- index.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 333349d..906cf3b 100755 --- a/index.js +++ b/index.js @@ -1,2 +1,13 @@ #!/usr/bin/env node -console.log(process.argv); +fs = require('fs'); + +var parseFile = function(data){ + console.log(data); +} +fs.readFile(process.argv[2], 'utf8', function(err, data){ + if(err){ + console.log(err); + } else { + parseFile(data); + } +});