Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

go-webp

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

go-webp

go-webp is a tool that helps develop convert all images (.png,.jpg and .jpeg) to webp image format by just one simple command line

  • 1.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

go-webp Logo

go-webp

go-webp is a tool that helps develop convert all images (.png,.jpg and .jpeg) to webp image format by just one simple command line

NPM Version NPM Install Size NPM Downloads

why use webp image format

  1. provides superior lossless and lossy compression for images on the web.
  2. create smaller, richer images that make the web faster
  3. WebP lossless images are 26% smaller in size compared to PNGs. WebP lossy images are 25-34% smaller than comparable JPEG images at equivalent SSIM quality index.
  4. Lossless WebP supports transparency (also known as alpha channel) at a cost of just 22% additional bytes.

why use go-webp package

instead of go to online services and upload you images and convert it to webp then change images name in files where use its

go-webp with one simple line in package.json:

  1. convert all images (.png, .jpg, .jpeg) to webp format
  2. remove old format of images (.png, .jpg, .jpeg)
  3. change images names in files where you use its

Installation

Either through cloning with git or by using npm (the recommended way):

npm install -g go-webp # or using yarn: yarn global add go-webp

And go-webp will be installed globally to your system path.

You can also install go-webp as a development dependency:

npm install --save-dev go-webp # or using yarn: yarn add go-webp -D

With a local installation, go-webp will not be available in your system path or you can't use it directly from the command line. Instead, the local installation of go-webp can be run by calling it from within an npm script (such as npm start) like the example below or using npx go-webp.

{
	"name": "...",
	"version": "0.1.0",
	"dependencies": {
		"...":"..."
	},
	"scripts": {
		"...": "...",
		"webp": "go-webp remove=true change=true"
	}
}

then you use

npm run webp # or using yarn: yarn run webp

Usage

By default go-webp change images names in files where you use its but not remove old images format (.png, .jpg, .jpeg) and

go-webp

For CLI options

  1. use the remove=true argument to remove old images format (.png, .jpg, .jpeg)
go-webp remove=true
  1. use the change=false argument to not change images names in files where you use its
go-webp change=false
  1. you can also combine them remove=true change=true to remove old images format (.png, .jpg, .jpeg) and change images names in files where you use its
go-webp remove=true change=true
  1. use the excludeFolders="public,api" argument to exclude folders from convertion
go-webp excludeFolders="public,api"
  1. use the excludeFiles="logo.png,favicon.ico,thumbnail.jpeg" argument to exclude files from convertion
go-webp excludeFiles="logo.png,favicon.ico,thumbnail.jpeg"

Bonus For React Developers: use exclude files for logo192.png, logo512.png, and favicon.ico

{
	"name": "...",
	"version": "0.1.0",
	"dependencies": {
		"...":"..."
	},
	"scripts": {
		"...": "...",
		"webp": "go-webp remove=true change=true excludeFiles=\"logo192.png,logo512.png,favicon.ico\""
	}
}

Support

This package costs me time to make and maintain every time.

[I am very 😀 about every coffee!]

Buy Me A Coffee

Keywords

FAQs

Package last updated on 24 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc