GithubHelp home page GithubHelp logo

gamersforever1695 / nodejs-image-squeezer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lorddashme/nodejs-image-squeezer

0.0 1.0 0.0 58.9 MB

A simple NodeJS package for image compression powered by FFMPEG.

License: MIT License

JavaScript 13.24% TypeScript 86.76%

nodejs-image-squeezer's Introduction

NodeJS Image Squeezer

A simple NodeJS package for image compression powered by FFMPEG.

Build Status Coverage Status NPM version

Requirement(s)

  • Node.js 8.0.* up to latest.

  • Operating System: Windows, Linux.

  • FFMPEG Binaries or Executable File:

Install

via NPM

  • Use the command below to install the package via npm:
npm install nodejs-image-squeezer --save

Usage

  • Below are the simple implementation of the package using TypeScript:
// Import the main class of the NodeJS Image Squeezer.
import ImageSqueezer from 'nodejs-image-squeezer';

// Initialize the main class.
var imageSqueezer = new ImageSqueezer();

// Load the necessary requirements and validate
// if the package fit for the current environment.
imageSqueezer.load();

// Set the path of binary file of ffmpeg.
imageSqueezer.setFFMpegBin('/path/to/binary');

// Provide the source file path of the desire image
// that will be compress later on.
imageSqueezer.setSourceFilePath('/path/source-filename');

// Provide the output file path of the compressed image.
imageSqueezer.setOutputFilePath('/path/output-filename');

// Execute the image compression.
imageSqueezer.compress();
  • Basic implementation of the package without superset libraries of JavaScript (using a pure Node.js syntax):
// Require the main class of the NodeJS Image Squeezer.
var ImageSqueezer = require('nodejs-image-squeezer');

// Initialize the main class.
var imageSqueezer = new ImageSqueezer();

// Load the necessary requirements and validate
// if the package fit for the current environment.
imageSqueezer.load();

// Set the path of binary file of ffmpeg.
imageSqueezer.setFFMpegBin('/path/to/binary');

// Provide the source file path of the desire image
// that will be compress later on.
imageSqueezer.setSourceFilePath('/path/source-filename');

// Provide the output file path of the compressed image.
imageSqueezer.setOutputFilePath('/path/output-filename');

// Execute the image compression.
imageSqueezer.compress();

License

This package is open-sourced software licensed under the MIT license.

nodejs-image-squeezer's People

Contributors

lorddashme avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.