This outputs the text exactly as typed—line breaks included—without manual newline characters.
For Node.js versions before ES6, you can use line continuations with backslashes:
But note that these don’t preserve actual newlines.
Also Read: Node.js Developer Hourly Rate
Alternatively, for dynamic content, build an array and join it:
eSparkBiz is rated 4.9 Stars
Real People, Real Stories
See why 300+ startups & enterprises trust eSparkBiz with their software outsourcingIf you’re trying to run nodemon from the terminal and see the error: nodemon: command not found, it usually means the nodemon package is not…
Writing to files is a common task in Node.js, whether for logging, saving uploads or creating reports. Node.js has various methods through the built-in fs…
Startups succeed when they move fast and that requires the right technology. Node.js Developers have become the backbone for agile teams, powering scalable, high-performance apps…
Let’s discuss how our dedicated experts can help.