@clefayomide/image-resizer
v0.1.6
Published
### Installation
Downloads
13
Readme
Getting started
Installation
This package can be installed using npm
npm i @clefayomide/image-resizer
or, yarn
yarn add @clefayomide/image-resizer
Usage
Import image_resize
import { image_resize } from '@clefayomide/image-resizer';
Wrapping things up
const file = e.target.files[0];
image_resize(file, 500)
.then(res => {
// perform an action with the resized file, such as sending to server
})
.catch(err => console.error(err));
Arguments
Available props:
| Argument | Description | type |
| -------- | ----------------------------------- | --------- |
| file
| the file to be resized | File
| width
| the required width for the new file | number
Issues
If any issues are found, they can be reported here.
License
This project is licensed under the MIT license.