Skip to content

Instantly share code, notes, and snippets.

@having-fun-coding
Created May 18, 2015 19:45
Show Gist options
  • Select an option

  • Save having-fun-coding/bcb94b763740d8327915 to your computer and use it in GitHub Desktop.

Select an option

Save having-fun-coding/bcb94b763740d8327915 to your computer and use it in GitHub Desktop.
My First I/o! | Node.js
var fs = require('fs');
var thefile = process.argv[2];
var file = fs.readFileSync(thefile);
var contents = file.toString();
console.log(contents.split('\n').length - 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment