npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

how-wide-is-it

v0.2.3

Published

Tells you how wide and tall a monitor is when given the aspect ratio and diaganol length.

Readme

How-Wide-Is-It

Tells you how wide a monitor is when given the dimensions and aspect ratio. Or what the size of the monitor should be to fill up a certain width or height

Install:

For use in your JS

npm i how-wide-is-it --save

For use as CLI

npm i how-wide-is-it -g

Example:

###How Wide is a 27" monitor that is 16:9?

var actualSize = require( 'how-wide-is-it' );
console.log( actualSize( 16, 9, 27 ) );

{ 
	height: 13.237053470079092,
	width: 23.53253950236283,
	aspRatio: '16:9',
	diagonal: 27 
}

console.log( actualSize( {
    width: 16,
    height: 9,
    diag: 27
} ) )

{ 
	height: 13.237053470079092,
	width: 23.53253950236283,
	aspRatio: '16:9',
	diagonal: 27 
}

What size monitor would fill up a 23" space that is 16:9?


var actualSize = require( 'how-wide-is-it' );
console.log( actualSize.diag( 16, 9, 23 ) );

{ 
  height: 12.9375,
  width: 23,
  aspRatio: '16:9',
  diagonal: 26.388992141610863
  }
  
console.log( actualSize.diag( {
  width:16,
  height:9,
  length:23,
  lengthIsOnWideSide:true
} ) );

{ 
  height: 12.9375,
  width: 23,
  aspRatio: '16:9',
  diagonal: 26.388992141610863
  }

Truncation option

If you would like your numbers to be truncated to a certain length simply follow this: actualSize.truncate=2 This will truncate all values to 2 decimal places.

CLI Options

How Wide Is It Cli Tool

  This Program helps determine the actual dimensions of a tv when given the
  aspect ratio and diagonal inches.

Possible Modes

  default    Use this mode if you have the aspect ratio and the diagonal. Does not need to be specified.
  diagonal   Use this mode if you have the aspect ratio and one side. The side defaults to the width but
             can be reversed by adding the -r flag. Usage: how-wide --diag -w 16 -h 9 -l 23

Options

  --help                Display this usage guide.
  -w, --width number    The width of the aspect ratio. Ex: 16:9 it's the 16, 4:3 it's the 4
  -h, --height number   The height of the aspect ratio. Ex: 16:9 it's the 9, 4:3 it's the 3
  -l, --length number   The length of the diagonal inches across. OR if in diagonal mode the length
                        of the width side.
  -d, --diag            Sets the mode to be in diagonal mode meaning we are searching for the
                        diagonal of the screen.
  -r, --reverse         If in diagonal mode this reverses the length to be on the height side.