Monday, 20 July 2020

How to avoid auto-indent in node interpreter?

Here is the code in question:$ cat test.js code = ` line 1 line 2 line 3 ` console.log(code) $ node test.js line 1 line 2 line 3 So far so good. But if I load the script in by running it inside the interpreter itself it does undesired auto-indenting:$ node Welcome to Node.js v14.5.0. Type ".help" for more information. > .load test.js code = ` line 1 line 2 line 3 ` console.log(code) line 1 line 2 line 3 undefined > code '\nline 1\n line 2\n line 3\n ' As you can see, the third line gets more spaces than it should.Is there a way to turn off this behavior? I've searched online and come up empty. Thanks for any help.

Submitted July 20, 2020 at 10:20AM by ApproximateIdentity

No comments:

Post a Comment