Socket
Book a DemoInstallSign in
Socket

aspect-ratio

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aspect-ratio

Get the screen aspect ratio of a device

latest
Source
npmnpm
Version
2.1.7
Version published
Weekly downloads
587
-16.5%
Maintainers
1
Weekly downloads
 
Created
Source

aspect-ratio

Last version Coverage Status NPM Status

Get the aspect ratio of a device.

Install

npm install aspect-ratio --save

Usage

with Node.js

const ratio = require('aspect-ratio')
console.log(ratio(1920, 1080)) // => 16:9
console.log(ratio(1920, 1080, '/')) // => 16/9

with CLI

$ aspect-ratio

  Get the screen aspect ratio of a device

  Usage
    $ aspect-ratio <width><height>[options]

    options:
     -s          specified a separator. (by default is ':').
     --version   output the current version.

    examples:
     aspect-ratio 1920 1080
     aspect-ratio 800 600 -s /

License

MIT © Kiko Beats

Keywords

aspect

FAQs

Package last updated on 04 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts