Skip to content
This repository has been archived by the owner on Feb 18, 2022. It is now read-only.
/ screensize Public archive

Calculate screen dimensions from diagonal and resolution

License

Notifications You must be signed in to change notification settings

RiverSongFox/screensize

Repository files navigation

screensize NPM version Build Status Dependency Status Coverage percentage

Calculate screen dimensions from diagonal and resolution

Installation

$ npm install --save screensize

Usage

var screensize = require('screensize');

screensize.calculate(5.70, 2560, 1440);
// {width: 4.96798..., height: 2.79449...}

var screen = screensize.guess('Full HD, 21.5 inches');
screen.widthIn('in');    // 18.74 inches
screen.diagonalIn('cm'); // 54.61 centimeters
screen.pixelsPer('in');  // 102.46 pixels per inch
screen.pixelsPer('mm');  // 4.03 pixels per millimeter

Supported units: m, dm, cm, mm, in, px.

License

MIT © Nikolay Kim

About

Calculate screen dimensions from diagonal and resolution

Resources

License

Stars

Watchers

Forks

Packages