https://github.com/Kikobeats/aspect-ratio
Get the screen aspect ratio of a device.
https://github.com/Kikobeats/aspect-ratio
Last synced: 25 days ago
JSON representation
Get the screen aspect ratio of a device.
- Host: GitHub
- URL: https://github.com/Kikobeats/aspect-ratio
- Owner: Kikobeats
- License: mit
- Created: 2014-12-12T10:59:33.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-10-24T10:48:02.000Z (over 1 year ago)
- Last Synced: 2025-03-31T15:11:25.680Z (27 days ago)
- Language: JavaScript
- Size: 115 KB
- Stars: 8
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# aspect-ratio

[](https://coveralls.io/github/Kikobeats/aspect-ratio.)
[](https://www.npmjs.org/package/aspect-ratio.)> Get the aspect ratio of a device.
## Install
```bash
npm install aspect-ratio --save
```## Usage
### with Node.js
```js
const ratio = require('aspect-ratio')
console.log(ratio(1920, 1080)) // => 16:9
console.log(ratio(1920, 1080, '/')) // => 16/9
```### with CLI
```bash
$ aspect-ratioGet the screen aspect ratio of a device
Usage
$ aspect-ratio [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](http://www.kikobeats.com)