Y
Y
Yuri Matveenko2020-04-21 01:57:05
JavaScript
Yuri Matveenko, 2020-04-21 01:57:05

Link in terminal node console.log(). How to post a link?

Once I saw how through console.log () in nodejs they indicated a link that could be opened by clicking in the terminal. How can I do that?

More specifically...

server.listen(port, hostname, () => {
  console.log(`My server running at`, `http://${hostname}:${port}/`);
});


Here you need http://${hostname}:${port} to be a link in the terminal

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2020-04-21
@deepblack

To do this, just print it to the console.
Further, selecting it as a link depends on the console itself.
On Mac and Linux, this is usually enabled by default.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question