Try splitting on a regex like /\r?\n/
to be usable by both Windows and UNIX systems.
> "a\nb\r\nc".split(/\r?\n/)
[ 'a', 'b', 'c' ]
More Related Contents:
- JavaScript binding of global result is undefined [closed]
- map function for objects (instead of arrays)
- Async/Await Class Constructor
- Check if every element in one array is in a second array
- Node JS Promise.all and forEach
- How can I wait In Node.js (JavaScript)? l need to pause for a period of time
- how to set socket.io origins to restrict connections to one url
- var vs this in Javascript object
- How can I set response header on express.js assets
- How to add custom html attributes in JSX
- Why doesn’t instanceof work on instances of Error subclasses under babel-node?
- How to clone a javascript ES6 class instance
- Angular 2 – How to pass URL parameters?
- Sending message to a specific connected users using webSocket?
- Asynchronous constructor
- how does axios handle blob vs arraybuffer as responseType?
- Javascript console.log(object) vs. concatenating string
- Webpack Express Cannot Resolve Module ‘fs’, Request Dependency is Expression
- How to structure nested Promises
- Accessing Express.js local variables in client side JavaScript
- Mongoose: Find, modify, save
- Exporting Node module from promise result
- Limit concurrency of pending promises
- What is the difference between .js and .mjs files?
- Iterate over object keys in node.js
- Accessing line number in V8 JavaScript (Chrome & Node.js)
- Nodejs: how to clone an object
- socket.io, ‘Access-Control-Allow-Origin’ error
- node.js, express, how to get data from body form-data in post request
- How to use npm modules in browser? is possible to use them even in local (PC)?