aspect-ratio

2.1.5 • Public • Published

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

Package Sidebar

Install

npm i aspect-ratio

Weekly Downloads

603

Version

2.1.5

License

MIT

Unpacked Size

6.52 kB

Total Files

6

Last publish

Collaborators

  • kikobeats