I need to work with css in a js script for nodejs. However if the css has some line break the console.log does not work.
const fs = require('fs'); var contents = fs.readFileSync('style.css').toString(); console.log(contents);
However, I take the spaces out to see that the content has been loaded:
console.log(contents.replace(/\s/g, "\r"););
The problem is that I need to display with all line breaks in my project.
I'm starting on Nodejs. If someone can explain to me why this is resolved.
I'm running nodeJS inside php exec:
$exec = exec($nodejs." p.js ", $output); echo $exec;