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-checksumrenametpl

v0.0.6

Published

Renames a file with its checksum and can update template file content with the new name. Useful for preventing browser to cache .js or .css files.

Readme

grunt-checksumrenametpl

Renames a file with its checksum and can update template file content with the new name. Useful for for preventing browser to cache old .js or .css files.

Getting Started

npm install grunt-checksumrenametpl --save-dev

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

grunt.loadNpmTasks('grunt-checksumrenametpl');

Usage example

checksumrenametpl: {
  js: {
      srcFile:     'build/js/js.min.js',
      destFileTpl: 'www/scripts/js-[CHECKSUM].min.js',
      replaceFile: ['php/templates/main.tpl'],
      replaceTpl:  'src="/scripts/js-[CHECKSUM].min.js"></script>',
  }

This task will:

  1. Calculate md5 checksum of build/js/js.min.js (let's say that checksum is ad6466b2aaf7e9c9ba0494df9c813c13).
  2. Move build/js/js.min.js to www/scripts/js-ad6466b2aaf7e9c9ba0494df9c813c13.min.js
  3. In php/templates/main.tpl file, replace all occurrences of
    src="/scripts/js-OLDCHECKSUM.min.js"></script>
    with
    src="/scripts/js-ad6466b2aaf7e9c9ba0494df9c813c13.min.js"></script>
    OLDCHECKSUM here can be any md5 checksum which will be replaced with the new one.
    Note that the file name in the HTML page must contain some checksum that will be updated. For the first time you run this task you can put any md5 checksum into the HTML.
  4. Delete all files with an invalid checksum from www/scripts/ directory.

Params description

  • srcFile - File to be renamed.
  • destFileTpl - Template string which define a new name for the srcFile. [CHECKSUM] will be replaced with md5 hash of the file.
  • replaceFile - Files which content needs to be updated with the new file name. You can specify more files here and use grunt globing patterns.
  • replaceTpl - Template string which define a partition of replaceFile content in which [CHECKSUM] will be replaced with md5 hash of the file. This can be any string which contains [CHECKSUM].