Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

js-aspect-ratio

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-aspect-ratio

a simple package for calculate the aspect ratio

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by33.33%
Maintainers
1
Weekly downloads
 
Created
Source

js-aspect-ratio

A simple package for calculate the aspect ratio

Install

npm install js-aspect-ratio

Synopsis

Get aspect with ratio 4:3 from a height of 375px

var AspectRatio = require('./dist/index.js').default // you must import like **require('js-aspect-ratio')**
var aspectRatio = new AspectRatio(4, 3) // Here you must specify the want aspect ratio 4:3, 16:9

var test = require('tape')

test('Get width ratio 4:3 from a height of 375px', function (t) {
  t.plan(1)
  t.equal(aspectRatio.getWidth(375), 500)
})

Or get a aspect height ratio 4:3 from a width of 500px

test('Get height ratio 4:3 from a width of 500px', function (t) {
  t.plan(1)
  t.equal(aspectRatio.getHeight(500), 375)
})

License

MIT

Keywords

FAQs

Package last updated on 26 Mar 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc