npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

go-webp

v1.3.1

Published

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

Downloads

140

Readme

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!]