Express middleware for cache busting static assets by appending a version query string. Uses the package version from package.json in production/integration, and appends a timestamp in development to force reloads. Stable version 1.2.0. Minimal configuration—attach to the app via handler() and use cacheBust() in templates. Differentiators: zero-config version detection, automatic dev vs prod behavior, and support for custom version or package path.
npm install cache-bustedNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows initialization and usage of cache-bust with Express, including how to call handler and use cacheBust in templates.
Ensure cacheBust.handler(app) is called before rendering any template that uses cacheBust().
Set NODE_ENV to 'production' or 'integration' for stable version-based caching, or explicitly pass a version option.
Set options.packageLocation to the correct path or options.version to a specific version string.
Use a build tool (Webpack, Vite) for cache busting via content hashes instead of this middleware.
Use const cacheBust = require('cache-busted'); then cacheBust.handler(app);Pass options.version or set options.packageLocation to correct path.
Ensure app is passed to cacheBust.handler(app) before rendering.
No dependency data recorded yet.