Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get screen resolution with node.js

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.

like image 353
Agneli Avatar asked Sep 24 '13 18:09

Agneli


People also ask

How do I check my screen resolution in HTML?

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).

How do I find my screen resolution in CSS?

Use window. innerWidth and window. innerHeight to get the current screen size of a page.

How do I check my screen resolution in Chrome?

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.


1 Answers

There is now a screenres module via npm:

https://www.npmjs.com/package/screenres

like image 138
charlie roberts Avatar answered Sep 20 '22 05:09

charlie roberts