
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
hash-filename
Advanced tools
hash-filename is a command line tool that puts the hash of a file into its filename.
Installation: npm install -g hash-filename
$ ls
app.css app.js vendor.js
$ hash-filename *.css *.js
{
"app.css": "app-f1d2d2f924e.css",
"app.js": "app-e242ed3bffc.js",
"vendor.js": "vendor-6eadeac2dad.js"
}
$ ls
app-e242ed3bffc.js app-f1d2d2f924e.css app.css app.js vendor-6eadeac2dad.js vendor.js
$ hash-filename --help
Usage: hash-filename [options] <files>
Options:
-h, --help output usage information
-V, --version output the version number
-a, --algorithm <name> Hash algorithm [sha1]
-l, --length <n> Hash length [11]
Copies the given files with a hash of their contents put into to their filenames.
Writes a JSON map of original filenames to hashed filenames to stdout.
It is useful for cache busting. The outputted JSON map can be used to update references to the unhashed filenames.
For example, you could create a function such as the following, expose it to templates and wrap file paths in it.
var map = production ? require("./map") : {} // You can even require .json files!
function file(path) {
return map[path] || path
}
The above function uses the original paths during development and the hashed ones during production. And if for some reason a path would be missing from the map during production, it falls back to the original path.
You could also feed the map directly to a replacement tool such as map-replace to update static files:
hash-filename *.css *.js | map-replace -m "<[^>]+>" *.html
FAQs
A command line tool that puts the hash of a file into its filename.
We found that hash-filename 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
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.