
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
grunt-crusher
Advanced tools
#grunt-crusher
A grunt plugin for processing images.
##How to use
Install with: npm install grunt-crusher
.
Call grunt.loadNpmTasks('grunt-crusher')
in grunt.js
In your grunt.js config:
crusher: {
taskOne: {
imageDirectory: '/path/to/images/',
files: [
'/path/to/images/foo-*.png',
],
crusherTasks: {
pngquant: {
binLocation: './bin/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,
crusherTasks: {
pngquant: {
binLocation: './bin/pngquant'
},
pngout: {
binLocation: './bin/pngout'
}
}
}
}
##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 crusher 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
pngout
convert
: Experimental; I have it configured with a global install that I compile per-machine, which seems to be the way to go with imagemagick. See the tests for usage.
##Changelog
Current: v0.1.15
Major Changes:
outputSuffix
.convert
, initially for resize.imageDirectory
and keepDirectoryStructure
settings.dest
-> destination
in task settings.pngout
, start working on how different bins will operate together.Copyright (c) 2012 George Pantazis Licensed under the MIT license.
FAQs
A grunt plugin that will straight-up crush some images.
We found that grunt-crusher demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.