Package Exports
- webp-converter
- webp-converter/cwebp
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (webp-converter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
A small node.js library for converting any image to webp file format or converting webp image to any image file format.
This module uses cwebp and dwebp precompiled executables of WebP Libraries for more info visit WebP
How to use
//get module
var webp=require('webp-converter');
//pass input_image(.jpeg,.pnp .....) path ,output_image(give path where to save and image file name with .webp file type extension)
webp.cwebp("nodejs_logo.jpg","output.webp","80",function(status)
{
//if conversion successfull status will be 'converted successfully'
console.log(status);
});
//pass input_image(.webp image) path ,output_image(.jpeg,.pnp .....)
webp.dwebp("nodejs_logo.webp","output.jpg",function(status)
{
//if conversion successfull status will be 'converted successfully'
console.log(status);
});
//or
//pass input_image(.jpeg,.pnp .....) path ,output_image(give path where to save and image file name with .webp file type extension)
webp.cwebp("old/nodejs_logo.jpg","new/output.webp","80",function(status)
{
//if conversion successfull status will be 'converted successfully'
console.log(status);
});
//pass input_image(.webp image) path ,output_image(.jpeg,.pnp .....)
webp.dwebp("old/nodejs_logo.webp","new/output.jpg",function(status)
{
//if conversion successfull status will be 'converted successfully'
console.log(status);
});
Installation
$ npm install webp-converter