UNPKG

calculate-aspect-ratio

Version:

A simple utility function, and command line utility, for calculating an aspect ratio based on width and height.

20 lines (15 loc) 424 B
#!/usr/bin/env node import calculateAspectRatio from './index'; import program from 'commander'; import pkg from './package.json'; let widthVal = 1920; let heightVal = 1080; program .version(pkg.version) .arguments('[width] [height]') .action((width, height) => { widthVal = width; heightVal = height; }) .parse(process.argv); console.log(`Aspect ratio: ${calculateAspectRatio(widthVal, heightVal)}`);