image-thumbnail-priyanka1
v1.0.6
Published
test-package-creation
Downloads
3
Readme
image-thumbnail
Through this package you can make thumbnail of your image.
Supported image type:
- jpeg/jpg
- png
Installation
npm i image-thumbnail-priyanka1
Example usage
const imagethumbnail = require("image-thumbnail-priyanka1")
const express = require("express");
const app = express.Router();
app.post('/upload', async (req, res) => {
const file = req.files.file;
const result = await imagethumbnail.makethumbnail(file,__dirname)
const message = result.message
if (message){
res.json({
message
})
}
})
Here makethumbnail is the main function that perform all work for you.
It accepts two paramters
- file
- directory name (to save your thumbnail image locally)