E
E
Egor Sabyanin2021-04-04 18:00:51
JavaScript
Egor Sabyanin, 2021-04-04 18:00:51

How to get node.js screen resolution?

Need to get the screen size with node.js It's often advised to download third party modules like this , but is it possible to get the sizes natively?

I say right away that there is no window object in node.js, so advice like window.screen will not work.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2021-04-04
@EgoSab

The node running on the server can only get the screen size on the client. So either embed a client script or create a database of user agents and try to correlate them with mobile phones. It won't work for desktop.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question