TonyBrobston / jpegasus

A lean client-side JavaScript image compressor.
MIT License
11 stars 2 forks source link
hacktoberfest

jpegasus

A client-side JavaScript tool that takes in a File of type .jpeg, .png, or .gif and returns a compressed File of type .jpeg. It's as easy as taking out the trash! 🗑

npm version Build Status codecov Dependencies Dev Dependencies Peer Dependencies Maintainability Known Vulnerabilities All Contributors

Implementation example

Code example

const jpegasus = require('jpegasus');

function processFile(file) {
    return jpegasus.compress(file, {
        maxHeight: 1000,
        maxWidth: 1000,
        quality: 0.65
    });
}

module.exports = {
    processFile
};

Documentation

compress(file: File, inputOptions: InputOptions): Promise‹File | Blob›

determineOrientation(file: File | Blob): Promise‹number›

Caution

Feedback

Do you have an idea for making jpegasus better? Add your idea under the issues tab, we'd love to hear about it!

Contributors

Thanks goes to these wonderful people:

Tony Brobston
Tony Brobston

💻
KANG
KANG

🎨 💻
lounsbrough
lounsbrough

💻
Tate Button
Tate Button

🤔