Skip to content

Instantly share code, notes, and snippets.

@CodeLuca
Created February 13, 2015 22:27
Show Gist options
  • Save CodeLuca/183a1fa032aea4b6b836 to your computer and use it in GitHub Desktop.
Save CodeLuca/183a1fa032aea4b6b836 to your computer and use it in GitHub Desktop.
var fs = require('fs')
var r = fs.readFileSync('read');
r = r.toString();
var rArray = [];
rArray = r.split(' ');
var amount = 0;
for(var i = 0; i < rArray.length; i++){
if(rArray[i] == 'node.'){
amount++;
console.log('true');
}
}
if(amount == 0){
console.log('false');
}
console.log();
@CodeLuca
Copy link
Author

file that I'm looking at:

hello
my name is
luca
this is a reading file
for node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment