How in node to split string by newline (\'\\n\') ? I have simple string like var a = \"test.js\\nagain.js\" and I need to get [\"test.js\", \"again.js\"]<
var a = \"test.js\\nagain.js\"
[\"test.js\", \"again.js\"]<
If the file is native to your system (certainly no guarantees of that), then Node can help you out:
var os = require('os'); a.split(os.EOL);
This is usually more useful for constructing output strings from Node though, for platform portability.