่ฑ†่ฑ†ๅ‹ๆƒ…ๆ็คบ๏ผš่ฟ™ๆ˜ฏไธ€ไธช้žๅฎ˜ๆ–น GitHub ไปฃ็†้•œๅƒ๏ผŒไธป่ฆ็”จไบŽ็ฝ‘็ปœๆต‹่ฏ•ๆˆ–่ฎฟ้—ฎๅŠ ้€Ÿใ€‚่ฏทๅ‹ฟๅœจๆญค่ฟ›่กŒ็™ปๅฝ•ใ€ๆณจๅ†Œๆˆ–ๅค„็†ไปปไฝ•ๆ•ๆ„Ÿไฟกๆฏใ€‚่ฟ›่กŒ่ฟ™ไบ›ๆ“ไฝœ่ฏทๅŠกๅฟ…่ฎฟ้—ฎๅฎ˜ๆ–น็ฝ‘็ซ™ github.comใ€‚ Raw ๅ†…ๅฎนไนŸ้€š่ฟ‡ๆญคไปฃ็†ๆไพ›ใ€‚
Skip to content

ahmadawais/resize-optimize-images

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

16 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

resize-optimize-images

DOWNLOADS Learn VSCode Follow @MrAhmadAwais on Twitter

๐Ÿ—ƒ Resize and optimize bmp, gif, jpeg, png, & tiff images in Node.js.


๐Ÿ“Ÿ

Install

npm install resize-optimize-images

โš™๏ธ

Usage

const resizeOptimizeImages = require('resize-optimize-images');

(async () => {
	// Set the options.
	const options = {
		images: ['path/to/image.jpg', 'path/to/image.png'],
		width: 1920,
		quality: 90
	};

	// Run the module.
	await resizeOptimizeImages(options);
})();

๐Ÿ“ƒ

API

resizeOptimizeImages(options)

โฏ options

Type: object

You can specify the options below.

images

Type: Array

Array of paths to images that you want to resize and optimize.

width

Type: Number
Default: 1920

A number value of width e.g. 1920.

height

Type: Number

Optional number value of height e.g. 1080. If you don't pass a height then image is scaled accordingly with width to preserve the aspect ratio.

quality

Type: Number
Default: 90

Set image quality. 100 being the best quality.


๐Ÿ“

Changelog

โฏ Read the changelog here โ†’


KEY: ๐Ÿ“ฆ NEW, ๐Ÿ‘Œ IMPROVE, ๐Ÿ› FIX, ๐Ÿ“– DOC, ๐Ÿš€ RELEASE, and โœ… TEST

I use Emoji-log, you should try it and simplify your git commits.


๐Ÿ“ƒ

License & Conduct


๐Ÿ™Œ

Connect

GitHub @AhmadAwaisย (follow) To stay up to date on free & open-source software

Twitter @MrAhmadAwaisย (follow) To get #OneDevMinute daily hot tips & trolls

YouTube AhmadAwaisย (subscribe) To tech talks & #OneDevMinute videos

Blog: AhmadAwais.comย (read) In-depth & long form technical articles

LinkedIn @MrAhmadAwaisย (connect) On the LinkedIn profile y'all

About

๐Ÿ—ƒ Resize and optimize bmp, gif, jpeg, png, & tiff images in Node.js.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors