A CLI tool and Node.js library that renames files by appending a hash digest to their filenames for cache busting.
HashMark is a Node.js-based utility that renames files by appending a hash of their contents to the filename. It solves the problem of cache busting for static assets by generating unique filenames whenever file contents change, allowing aggressive caching without stale content.
Frontend developers and build engineers who need to automate cache invalidation for JavaScript, CSS, and other static assets in their deployment pipelines.
It offers a simple, scriptable solution with glob support and flexible output templates, making it easy to integrate into existing build processes without complex configuration.
Take contents of a file (or stdin), and output as new file with a hash in the name
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Handles glob patterns seamlessly across operating systems, including Windows, as shown in the README examples for processing multiple files with quotes for shell compatibility.
Uses customizable templates with placeholders like {hash}, {name}, and {ext}, allowing precise control over output filenames and directory structures, demonstrated in the shell examples.
Offers a library interface supporting streams, callbacks, and event emitters, enabling integration into custom build scripts, as detailed in the programmatic usage section.
Outputs a JSON map of original to hashed filenames, optionally saved to a file with the --asset-map flag, useful for build tool integration and reference updates.
As a single-purpose tool, it lacks advanced features like incremental hashing or watch mode, and requires additional tools like replaceinfiles for updating references in source files.
The README explicitly discourages contributions for new features, stating that changes might be rejected, which could hinder adaptation to specific or evolving project needs.
While the README covers basics, it lacks comprehensive examples for complex scenarios, such as integration with modern frameworks or handling large-scale asset pipelines.