readfile-split
Read a file into an array
Install
$ npm install --save readfile-split
Usage
var readfileSplit = ; // readfileSplit(filename[, options], callback) // options with defaultsvar options = // fs.readFile specific options encoding: null flag: 'r' // readfileSplit specific options emptyLines: true trimLines: true withSeperator: false seperator: /\r?\n/; ;// > null [ 'Hello,', '', 'Don\'t worry.', 'Be happy.', '', 'Goodbye!', '' ] optionsemptyLines = false;;// > null [ 'Hello,', 'Don\'t worry.', 'Be happy.', 'Goodbye!' ] optionsseperator = '.';;// > null [ 'Hello,\n\nDon\'t worry', 'Be happy', 'Goodbye!' ] optionswithSeperator = true;;// > null [ 'Hello,\n\nDon\'t worry.', 'Be happy.', 'Goodbye!' ] // etc.
License
ISC © Buster Collings