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

asset-converter

v1.0.8

Published

Boost your web performance by converting and optimizing image assets with this robust Node.js tool.

Downloads

20

Readme

Asset Converter

Asset Converter is a Node.js package that converts and optimizes image assets. It converts PNG and JPEG images to WebP format and generates lower-resolution versions of the images.

Features

  • Converts PNG images to WebP format
  • Converts JPEG images to WebP format
  • Generates lower-resolution versions of images
  • Supports recursive optimization of images in a folder tree
  • Automatically creates parent folders if necessary

Prerequisites

Before using the Asset Converter package, make sure you have the following prerequisites installed on your system:

  • Node.js (v14 or higher)
  • npm (Node Package Manager)

If you don't have Node.js and npm installed, you can download and install them from the official Node.js website: https://nodejs.org

Installation

To install the Asset Converter package, use npm:

#!/bin/bash
npm install asset-converter

Usage

After installing the package, you can use it as a command-line tool:

#!/bin/bash
npx asset-converter [PATH] [FLAGS]

Replace [PATH] with the path to the directory or image file you want to convert.

Flags

You can use the following flags with the Asset Converter package:

  • -r : Optimize images in the whole folder tree, create low-dpi and webp versions, and create a parent folder if necessary.
  • -o : Optimize an image or the images contained in a folder without creating a new parent folder.
  • -u : Optimizes the image if it is not already optimized and creates or replaces a new WebP and lowdpi version.
  • -f : Forces the execution of the command even if the image is already optimized.

Examples:

  • Optimize images in the whole folder tree, creating low-dpi and webp versions, and creating a parent folder if necessary:
#!/bin/bash
npx asset-converter /path/to/images -r
  • Optimize a single image or multiple images in a folder without creating a new parent folder:
#!/bin/bash
npx asset-converter /path/to/image.jpg -o
  • Optimize images in the whole folder tree, creating low-dpi and webp versions, and optimize an image or images contained in a folder without creating a new parent folder:
#!/bin/bash
npx asset-converter /path/to/images -or

In the first example, the command will optimize the images in the specified folder and its subfolders, create low-dpi and webp versions, and create a parent folder if necessary.

In the second example, the command will optimize a single image or multiple images in a folder without creating a new parent folder.

In the third example, the command will optimize the images in the specified folder and its subfolders, create low-dpi and webp versions, and optimize a single image or multiple images in a folder without creating a new parent folder.

Help

If you need assistance with the usage of the Asset Converter package, you can refer to the documentation or visit the project's repository for more information.

License

This software is licensed under the Creative Commons Attribution-NonCommercial (CC BY-NC) license.

You are free to:

  • Share: Copy and redistribute the software in any medium or format.
  • Adapt: Remix, transform, and build upon the software.

Under the following terms:

  • Attribution: You must give appropriate credit, provide a link to the license, and indicate if changes were made.
  • NonCommercial: You may not use the software for commercial purposes.

For more details about the license, please visit: https://creativecommons.org/licenses/by-nc/4.0/

Dependencies

This project uses the following packages:

Credits

This package was developed by:

We also want to thank the open-source community for their contributions and support.