I have JavsScript code with function print. It works correctly in console of web browser, but when I run this code using node i obtain error:
ReferenceError: print is not defined
Of course I can use console.log, but I would like to know why print is not implemented in node?
The print or window.print() opens the Print Dialog to print the current document.
In Contrast, the console.log() outputs a message to the Web Console.
If your intention was to actually print a file to a 'hardware printer', from Node.js then have a look at projects such as node-printer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With