calculate-aspect-ratio
Version:
A simple utility function, and command line utility, for calculating an aspect ratio based on width and height.
16 lines (11 loc) • 412 B
JavaScript
import calculateAspectRatio from './index';
import program from 'commander';
import pkg from './package.json';
var widthVal = 1920;
var heightVal = 1080;
program.version(pkg.version).arguments('[width] [height]').action(function (width, height) {
widthVal = width;
heightVal = height;
}).parse(process.argv);
console.log('Aspect ratio: ' + calculateAspectRatio(widthVal, heightVal));