grepit

Description
Grep Module for NodeSyntax
grep(pattern, file)
Parameters
patternRegExp or String to be searched for. (aka. the 'needle')
file
String - path and filename of file to be searched. (aka. the 'haystack')
Output
Returns an array. The elements of the array will be the lines in which the pattern appears.Usage
Installation$ npm install grepit
testfile.txt:
The first sentence of the text.
Now the second sentence.
Why not a third, a third that has a comma in it.
And then comes the fourth sentence.
Example
var grepit = require('grepit');
var result = grepit(/first/, 'test_file.txt');
// result = [ 'The first sentence of the text.' ]