https://github.com/opensrc0/compressfilesize
https://github.com/opensrc0/compressfilesize
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/opensrc0/compressfilesize
- Owner: opensrc0
- Created: 2017-09-15T06:55:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-15T06:56:26.000Z (over 8 years ago)
- Last Synced: 2025-02-10T15:15:14.598Z (over 1 year ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Compress File Size
Step 1:- Install this package using command
npm i compressfilesize
Step 2:- Include compressfilesize.js in your file
ex:-
import reduceFileSize from './compressFileSize/index.js'
Step 3:- reduceFileSize is a function in your file which having some parameter, first and second paramenter is mandatory.
a) First is the file object to reduce size.
b) Second is call back.
c) Other params are optional, You can checkout compressfilesize.js for pass other params.
ex:-
var fileObj = event.target.file[0];
reduceFileSize(fileObj, () => {
// Do stuff here after reducing size of file.
});