A native multiplatform module to query the system OS for displays info.
Get current screen info & print it to console:
import Screen from ".";
const mainScreen = Screen.main();
console.log(`
Current screen size is ${mainScreen}
${mainScreen.width} pixels width,
${mainScreen.height} pixels height,
${mainScreen.widthMM} mm width,
${mainScreen.heightMM} mm height,
${mainScreen.colorDepth} bits per pixels
`);This will output
Current screen size is 1920x1080x24
1920 pixels width,
1080 pixels height,
360 mm width,
210 mm height,
24 bits per pixels
main: () => {width:number, height: number, colorDepth: number}return the size and color depth of default system display
all: () => [{ width: number, height: number, colorDepth: number }];return the size and color depth of all system displays
With npm installed, run
$ npm install screen-info
MIT