I need get screen resolution with node.js, but the following code don't work.
var w = screen.width;
var h = screen.height;
This also don't work.
var w = window.screen.width;
var h = window.screen.height;
Someone know how to get screen resolution with node.js ? Thank you.
Answer: Use the window. screen Object You can simply use the width and height property of the window. screen object to get the resolution of the screen (i.e. width and height of the screen).
Use window. innerWidth and window. innerHeight to get the current screen size of a page.
Using the Chrome browser, right click / control click anywhere inside your content area and select Inspect Element. In Chrome, right-click (or control + click) in the content area and choose "Inspect Element" to open the element inspector.
There is now a screenres module via npm:
https://www.npmjs.com/package/screenres
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