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

easy-tinypng-cli

v0.4.1

Published

A cli can be used to compress images with tinypng.com

Downloads

53

Readme

easy-tinypng-cli

A cli can automatically compress images with tinypng.com.

NPM version

Why

When delevoping a website, we often need to compress images to reduce the network io cast.In normal way, we may need four steps to compress images:

  1. download images from the internet
  2. upload the image to tinypng.com
  3. download the compressed image from tinypng.com
  4. copy the compressd images into our workspace

The above steps are very time-consuming. So !!! this cli can automatically compress images in background process. It will watch the fileSystem changes to auto handle if there are any images that need to be compressed.

🚀 Features

  • 💾 Support configuration file
  • 🍁 Multiple directory watching
  • ✨ Support HMR
  • 🦋 Auto detection nested directory images and compress them
  • 🌝 Background process will not block the main thread
  • 🐻‍❄️ Compressed record logging to avoid repeated compression

Usage

Install

pnpm add -D easy-tinypng-cli

Config tiny.config.ts

  • APIKey (required) : the API key of tinypng.com, you can get it from tinypng.com

  • targetDir (required) : the top directory that you want to compress images

import { defineTinyConfig } from 'easy-tinypng-cli/utils'

export default defineTinyConfig({
  configs: [
    {
      targetDir: './src/images',
    },
  ],
  APIKey: 'xxxxxxxxx',
})

Add Script in package.json

{
  "scripts": {
    "optimizeImages": "tiny"
  }
}

or

{
  "scripts": {
    "optimizeImages": "tiny --once" //only compress once no watching files change
  }
}

Author

sudongyuer email:[email protected]

License

MIT License © 2021 SuDongYu