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

grunt-images

v0.2.1

Published

A grunt plugin for processing images.

Downloads

90

Readme

#grunt-images Build Status

A grunt plugin for processing images. As of v0.1.16 the supported libraries are compiled on the target machine on installation.

##How to use

  • Install with: npm install grunt-images.

  • Call grunt.loadNpmTasks('grunt-images') in grunt.js

  • In your grunt.js config:

    images: {
      taskOne: {
        imageDirectory: '/path/to/images/',
        files: [
          '/path/to/images/foo-*.png',
        ],
        tasks: {
          convert: {
            resizeDimension: '66%'
          },
          pngquant: {
          }
        }
      },
      taskTwo: {
        imageDirectory: '/path/to/images/',
        files: [
          '/path/to/images/foo/*.png',
          '/path/to/images/bar/*.png',
          '/path/to/images/baz/*.png'
        ],
        destination: IMAGES + '/optimized',
        keepDirectoryStructure: true,
        tasks: {
          pngquant: {
          }
        }
      }
    }

##Settings

imageDirectory required : Used to determine relative filepaths, in case you want to preserve the directory structure in the output folder. Files that aren't within this folder will be rejected.

files required : Array of files / wildcards for images to iterate through.

destination optional : If provided, copies files to the destination directory after optimizations are complete. If omitted, replaces original with optimized file.

outputSuffix optional : Use to add a suffix onto output filenames (someimage.jpg -> someimage_foo.jpg). Requires destination.

keepDirectoryStructure optional : If omitted or set to false, the destination folder will be flat. If set to true, destination folder will contain the original files' folder structure relative to imageDirectory.

crusherTasks required : Configure each bin. (TODO: Add config options in supported libraries section once available).

##Supported Libraries

pngquant

convert

##Changelog

Current: v0.1.16

Major Changes:

  • v0.1.16 Make convert (imagemagick) and pngquant compile on install, rather than requiring a bin location. Remove pngout since it can't be compiled / is close-sourced.
  • v0.1.15 Upgrade for Grunt 0.4 compatibility.
  • v0.1.12 Added outputSuffix.
  • v0.1.10 Added experimental support for convert, initially for resize.
  • v0.1.9 Added tests, some refactoring on logging.
  • v0.1.6 Add imageDirectory and keepDirectoryStructure settings.
  • v0.1.4 Make it so that you have to define the bin locations as part of the task; making it platform independant was too tricky here. dest -> destination in task settings.
  • v0.1.2 Adding pngout, start working on how different bins will operate together.
  • v0.1.1 Add optional destination/export directory.
  • v0.1.0 Initial release.

License

Copyright (c) 2012 George Pantazis Licensed under the MIT license.