Newlyweds Proposing Marriage
Join us to discuss the challenges, solutions and best practices for in-house JavaScript code sharing. Tuesday, 12/17 at 10am PT/1pm ET.Sign up here »

aspect-ratio

2.1.1 • Public • Published

aspect-ratio

Build Status Dependency status Dev Dependencies 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

Install

npm i aspect-ratio

DownloadsWeekly Downloads

1,975

Version

2.1.1

License

MIT

Unpacked Size

8.04 kB

Total Files

7

Last publish

Collaborators

  • avatar