jpegasus

    1.16.1 • Public • Published

    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

    • Note that when the preserveFileType option is true, the quality option will only work for files such as image/jpeg and image/webp per the MDN web docs here.

    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

    🤔

    Install

    npm i jpegasus

    DownloadsWeekly Downloads

    190

    Version

    1.16.1

    License

    MIT

    Unpacked Size

    34.8 kB

    Total Files

    25

    Last publish

    Collaborators

    • tonybrobston
    • lounsbrough