node-social-image-resizer

1.0.1 • Public • Published

node-social-image-resizer

Resize images to fit multiple social platforms Built on top of jimp

Getting started

To use it in node.js first install by:

npm install node-social-image-resizer --save

Then import it:

const socialResize = require('node-social-image-resizer');

Usage

Example

socialResize('./path/to/original.jpg','facebookProfile','./path/to/resized.jpg',0xFFFFFFFF)
.then(
    res => console.log(res) 
    //./path/to/resized.jpg
)
.catch( err => console.log(err));

parameters

socialResize(srcImgPath, socialPlatformType, destImgPath = srcImgPath, backgroundColor= 0x00000000)
  • srcImgPath: The path of the original image

  • socialPlatformType The platform type, types available: 'facebookProfile' 'facebookCover' 'twitterProfile' 'twitterHeader' 'instagramProfile' 'instagramPost' 'linkedinProfile' 'linkedinCover' 'pinterestProfile' 'youtubeProfile' 'youtubeCover' 'tumblrProfile'

  • destImgPath [String]: Destination image path (default = source image path)

  • backgroundColor[rgba hex]: (default is 0x00000000)

Readme

Keywords

Package Sidebar

Install

npm i node-social-image-resizer

Weekly Downloads

6

Version

1.0.1

License

MIT

Unpacked Size

4.33 kB

Total Files

5

Last publish

Collaborators

  • ragy96