1.0.7 • Published 5 years ago

convert-to-thumbnail v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

convert-to-thumbnail

N|Solid

Build Status

convert-to-thumbnail is npm module and tool, used to convert images(png,jpg,jpeg) to thumbnail which is smae in image retio and small size for easy accessing

#Requirment

  • source directory containing image file
  • destination directry

Features!

  • provide source and destination directory

Plugins

convert-to-thumbnail is currently extended with the following plugins. Instructions on how to use them in your own application are linked below.

PluginREADME
jimphttps://www.npmjs.com/package/jimp
image-sizehttps://www.npmjs.com/package/image-size
fshttps://www.npmjs.com/package/fs

Installation

$npm install --save convert-to-thumbnail

how to use

##convert directory contained images

var convertor = require('convert-to-thumbnail');

let dirSorcePath = __dirname+'/public/';
let dirDestPath = __dirname+'/converted/';

convertor.convertToThumbnail(dirSorcePath,dirDestPath)
.then(v =>{console.log("Successfully converting wait...once convert then only end this programm")})
.catch(err => console.error(err))

##convert single images

var convertor = require('convert-to-thumbnail');

let fileSorcePath = __dirname+'/public/IMG_20180916_172642057.jpg'
let fileDestPath = __dirname+'/converted/IMG_20180916_172642057.jpg'

convertor.convertImageToThumbnail(fileSorcePath,fileDestPath)
.then(v =>{console.log("Successfully converting wait...once convert then only end this program")})
.catch(err => console.error(err))

contribute

Want to contribute? Great! please mail to prathmeshn007@gmail.com with subject

"npm contribution convert-to-thumbnail"
1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago