I would like to do something like this:
console.log('Your server available at <a href="localhost:3000"> localhost:3000 </a>');
But unfortunately node console doesn't recognize 'a' tag.
Are any ideas how to put link in node console?
To create a multi line strings when printing to the JavaScript console, you need to add the new line character represented by the \n symbol. Alternatively, you can also add a new line break using Enter when you use the template literals syntax.
link() Method. The fs. link() method is used to create a hard link to the given path.
There is no way you can make an HTML tag interpreted by your the terminal, because your terminal has no ideas what html is.
You can just display a URL in console output like
console.log('Your server available at http://localhost:3000
Most modern terminals will automatically parse it as a URL (if you put a valid URL there)
For example, Mac default terminal redirects to valid URL from console output if you double-click on it while holding Cmd
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