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 🙏

© 2026 – Pkg Stats / Ryan Hefner

grunt-md5filename

v0.1.5

Published

Convert file names to MD5.

Readme

grunt-md5filename

NPM version Build Status Dependency Status endorse Bitdeli Badge Built with Grunt

Convert file names to MD5.

ex.) octocat.png -> c29b1fd35e7e51210f3264d567650ac7

Getting Started

This plugin requires Grunt ~0.4.0

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-md5filename --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-md5filename');

This plugin was designed to work with Grunt 0.4.x.

MD5filename task

Run this task with the grunt md5filename command.

Task targets, files and options may be specified according to the grunt Configuring tasks guide.

Options

pathType

Type: String Default: 'filename'

select MD5 target for file name or file name with path.

  • filename
    • file name
    • ex)
octcat.png
->  md5('octcat.png')
c29b1fd35e7e51210f3264d567650ac7
  • filepath
    • file name with path
    • ex)
img/github/octocat.png
->  md5('img/github/octocat.png')
ea8bfe94d1b4278fcd9dca963dde3e00

keepBasename

Type: Boolean Default: false

converted file name add to filename(exclude extension).

octcat.png
-> 'octcat' + '-' + md5(octcat.png)
octcat-c29b1fd35e7e51210f3264d567650ac7

keepExtension

Type: Boolean Default: false

converted file name add to extension.

octcat.png
-> md5(octcat.png) + '.png'
c29b1fd35e7e51210f3264d567650ac7.png

saltPrefix

Type: String Default: ''

prefix salt

octcat.png
-> md5('__PREFIX__octcat.png')
4dd44b339b8ee57d21894ac57c8ca571

saltSuffix

Type: String Default: ''

suffix salt

octcat.png
-> md5('octcat.png__SUFFIX__')
d43bc35325462bf21a3c7fba0902ed86

ignorePatterns

Type: Array Default: []

ignore file pattern

octcat.png
-> ignorePatterns: ['*.png'],
octcat.png

hashFile

Type: String Default: null

save hashmap file, json format.

{
  "src/octcat.png": "dest/c29b1fd35e7e51210f3264d567650ac7",
  "src/img/github/octocat.png": "dest/img/github/ea8bfe94d1b4278fcd9dca963dde3e00"
}

specification changes notice After v0.1.5, json hashmap file specification changes. Dest path changes to Grunt root directory relative path.

hashLength

Type: Number Default: null (32)

split the character length of a hash digest hex value to shorten string. MD5 is 32 characters in length default.

octcat.png
->  md5('octcat.png'), hashLength = 8
c29b1fd3

debug

Type: Boolean Default: false

output debug log.

File 'original/img/github/octocat.png' to 'htdocs/img/github/c29b1fd35e7e51210f3264d567650ac7.png' created.
...
…

Usage Examples

md5filename: {
  build: {
    options: {
      keepBasename: false,
      keepExtension: true,
      pathType: 'filename',
      hashFile: 'tmp/hash.json',
      hashLength: 20,
      debug: true,
    },
    expand: true,
    cwd: 'original/img/thumbnails/',
    src: ['**/*.{png,jpg}'],
    dest: 'htdocs/img/thumbnails/',
  },
}

Release History

  • 2014-03-28   v0.1.5   Json hashmap file specification changes. Dest path changes to Grunt root directory relative path.
  • 2013-12-13   v0.1.4   Add ignorePatterns option.
  • 2013-08-25   v0.1.3   Add hashLength option.
  • 2013-06-18   v0.1.2   Change hashFile path.
  • 2013-06-18   v0.1.1   Support hashFile option.
  • 2013-06-13   v0.1.0   Init.

Task submitted by Masayuki Ishikawa