Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrew--r/fit-to-area
https://github.com/andrew--r/fit-to-area
Last synced: about 6 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/andrew--r/fit-to-area
- Owner: andrew--r
- License: mit
- Created: 2018-07-05T11:04:38.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-07-16T10:23:12.000Z (over 6 years ago)
- Last Synced: 2024-11-07T03:46:15.390Z (12 days ago)
- Language: JavaScript
- Size: 141 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# @andrew-r/fit-to-area
## Install
```
$ npm install @andrew-r/fit-to-area
```## Usage
```js
const fitToArea = require('@andrew-r/fit-to-area');fitToArea({
areaDimensions: {
width: 5,
height: 5,
},
objectDimensions: {
width: 5,
height: 10,
},
});
//=> { width: 2.5, height: 5 }
```## API
```
type Dimensions = {|
width: number,
height: number,
|};fitToArea(options: {|
areaDimensions: Dimensions,
objectDimensions: Dimensions,
|}): Dimensions
```## License
MIT © [Andrey Romanov](https://github.com/andrew--r)