ncoded-storage-service
v0.1.18
Published
Library for resizing and uploading images
Downloads
5
Keywords
Readme
Ncoded server resized-image-file library
Install
yarn add ncoded-storage-service
Usage
Create storage service and service for resized and upload files, call functions
import { AWSStorageService, ResizedAndUploadService } from 'ncoded-storage-service'
const storageService = new AWSStorageService({bucketName,bucketRegion,accessKeyId,secretAccessKey})
const resizedAndUploadService = new ResizedAndUploadService()
//call function for resize image and create different image formats - from input read stream
const resizeImagesFromStream = resizedAndUploadService.fileImageResizeFromReadStream(inputStream)
//call function for resize image and create different image formats - from input buffer
const resizedImagesFromBuffer = resizedAndUploadService.fileImageResizeFromBuffer(inputBuffer)
//call function for file upload from input read stream
const uploadedFile = resizedAndUploadService.fileUploadFromReadStream(inputStream,key,mimeType,storageService)
//call function for file upload from input buffer
const uploadedFile = resizedAndUploadService.fileUploadFromBuffer(inputBuffer,key,mimeType,storageService)