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

img-compress-cli

v2.0.3

Published

Image compression tool: node-cil developed based on TinyPNG

Downloads

13

Readme

背景

前端项目开发过程中,往往需要对项目图片文件进行压缩。TinyPNG 有损压缩能够保证较高的文件质量和压缩效果,然而在线使用的情况下,需要先上传再下载,最后集中复制到目标文件夹,较为繁琐,同时存在上传数量限制。

介绍

压缩图片小工具,基于 tinypng 的二次开发的 node-cli,支持5MB以下的 WebP、JPEG、PNG 图片进行压缩,该工具的目的是打通上述背景描述的繁琐过程,解除数量限制,只需要在目标文件夹直接使用命令进行压缩,即可得到压缩好的图片文件夹用于项目使用。

安装方式

npm i img-compress-cli -g

使用方法

  1. 在需要压缩的图片文件夹调出命令行工具,输入 compress start 命令即可执行;

  2. 初次使用时会提示键入 api-key也可不填写直接回车,使用备用 key,需要和作者拿一下备用 key 文件);

  3. 压缩完毕后会得到 output 文件夹;

  4. 如果需要重置 api-key,请按顺序执行 compress initcompress start 命令;

api-key 获取方法

每个 key 每月有 500 个图片压缩的免费额度,备用 key 存在超额风险,为确保正常使用,强烈建议录入自己的 key

TinyPNG – 智能压缩您的 WebP、JPEG 和 PNG 图片

  1. 打开 TinyPng,通过邮箱及验证码进行登陆注册;

  1. 邮箱中通过链接进入后,登陆成功,选择账户页--API;

  1. 复制 API-KEY,在首次使用时录入即可,注意保证该 KEY 的状态是可用的;