0
I need to work with css in a js script for nodejs. However, if css has any line breaks the console.log does not work.
const fs = require('fs'); var contents = fs.readFileSync('style.css').toString(); console.log(contents);
However its I take the spaces of to see that it was loaded the content:
console.log(contents.replace(/\s/g, "\r"););
The problem is that I need to display with all the line breaks in my project.
I am inciting at Nodejs. If anyone can explain to me why this is and how to solve.
I’m running nodejs inside php exec:
$exec = exec($nodejs." p.js ", $output); echo $exec;
Show the css file there
– Jorge Costa
https://jsfiddle.net/6uLjr37o/
– Marcus Vinicius Tavares
Your code works correctly on my machine see in the image https://imagebin.ca/v/4932HMtdCHdt
– Jorge Costa
I’m using inside an exec in php on Windows system, this will be the problem?
– Marcus Vinicius Tavares
I just tried debian 9 linux system on my server and it doesn’t work either.
– Marcus Vinicius Tavares
I’ll try it on Linux
– Jorge Costa