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

imagemin-simple

v1.1.1

Published

Replace images with minified one and generate small base64 image.

Downloads

56

Readme

Imagemin-simple

Replace images with minified one and generate small base64 image.

Travis Codecov Status npm package npm downloads

prettier license

Usage

imagemin

$ npx imagemin-simple imagemin '**/*.{jpg,png,JPG,PNG,svg,gif}'

base64

$ npx imagemin-simple base64 '**/*.{jpg,png,JPG,PNG}' --output-file base64.json
{
  "test-content1/project1/images/ai-image.jpg": {
    "imagePath": "test-content1/project1/images/ai-image.jpg",
    "width": 1000,
    "height": 449,
    "format": "jpeg",
    "base64": "data:image/jpeg;base64,/9j/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAANAB4DASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAQYEBQcI/8QAJhAAAgEDAQcFAAAAAAAAAAAAAQIDAAQRBQYSExQxQVEhUpHB8P/EABUBAQEAAAAAAAAAAAAAAAAAAAQF/8QAGxEBAAICAwAAAAAAAAAAAAAAAQACAyESIjH/2gAMAwEAAhEDEQA/AOfo7aQIjvjhsxXI81ZPFHDDGzMDxBld3xQtMSo0AAXcQEP1J7/dSb6AchGSSRGhKgeg64pldSPc5ewaPcRW2qWdxMhliimSRo/cAwJFOW3OoW9/rIutMjaOFkwyFcFWJzj93pCsXIniYdVYH4rQNubjltH0iZYoTLcRJK7lBvElT4pGN0sn5zsAT//Z"
  },
  ...
}

API

imagemin-simple -h

imagemin-simple <command>

Commands:
  imagemin-simple imagemin  The imagemin command.
  imagemin-simple base64    Turn image into base64.

Options:
  -v, --version  Show version number                                   [boolean]
  -h, --help     Show help                                             [boolean]

For more information go to https://github.com/evenchange4/hsu-scripts

imagemin-simple imagemin -h

Usage: imagemin-simple imagemin <pattern> [options]
<pattern> Glob pattern to specify files.

Options:
  --plugin    The list of plugins to use.
                    [array] [default: ["jpegtran","pngquant","svgo","gifsicle"]]
  -h, --help  Show help                                                [boolean]
                                       [boolean]

Examples:
  imagemin-simple imagemin '**/*.{jpg,png,JPG,PNG,svg,gif}'
  imagemin-simple imagemin '**/*.png' --plugin pngquant

imagemin-simple base64 -h

Usage: imagemin-simple base64 <pattern> [options]
<pattern> Glob pattern to specify files.

Options:
  --output-file  The output json file.       [string] [default: "./base64.json"]
  --cwd          Set current working directory.                         [string]
  -h, --help     Show help                                             [boolean]

Examples:
  imagemin-simple base64 '**/*.{jpg,png,JPG,PNG}'
  imagemin-simple base64 '**/*.{jpg,png,JPG,PNG}' --output-file results.json
  imagemin-simple base64 '**/*.png' --cwd './docs'

cwd

The current working directory.

  • Default: process.cwd()
  • Examples:
# Default
$ npm run test:base64

# Set custom cwd
$ npm run test:base64-cwd

NOTE: Please check mrmlnc/fast-glob#cwd for more detail.

Development

  • node 12.3.1
  • yarn 1.16.0
$ yarn install --pure-lockfile
$ npm run test:base64

Test

$ yarn run build
$ yarn run flow-coverage
$ yarn run test:watch
$ yarn run test:base64
$ yarn run test:base64-cwd
$ yarn run format
$ yarn run eslint

Publish

$ npm version patch
$ npm run changelog
git commit & push

CONTRIBUTING

  • ⇄ Pull requests and ★ Stars are always welcome.
  • For bugs and feature requests, please create an issue.
  • Pull requests must be accompanied by passing automated tests.

CHANGELOG

LICENSE