
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@sparkbox/cachebust
Advanced tools
Straight forward asset fingerprinting "cachebuster" for production applications.
Requires Node 8.5.0 or higher.
Installing
npm install @sparkbox/cachebust
The recommended way to use cachebust
is to either add your
input data in package.json
or in a .cachebust.config
file (see config).
cachebust
: will create your fingerprinted assests & update fingerprinted "source file" names inside the
target "template file(s)" as specified in the package.json file or the .cachebust.config file.
If you need to restore your template files, you can run: cachebust --restore
Create a key in your package.json
file at the root level, with source/target keys.
For example:
{
...
"cachebust": {
"source": [
"path/to/source/css/style.css",
"path/to/source/js/script.js"
],
"target": [
"path/to/target/template.html"
]
}
...
}
Update: Globbing is allowed for target
files. So `target: ["path/to/target/**/*.html"] is allowed.
Also you may create a config file in the root of the project directory called .cachebust.config
This will be a JSON object like the following:
{
"cachebust": {
"source": [
"path/to/source/css/style.css",
"path/to/source/js/script.js"
],
"target": [
"path/to/target/**/*.html"
]
}
}
cachebust allows you to directly specify the source and the target you'll need to pass in a comma seperated list for example:
cachebust -s path/to/source/css/style.css,path/to/source/js/script.js -t path/to/target/template.html
Note Direct input will override the config and package json cacehebust paramaters.
This will fingerprint the following files:
- path/to/source/css/style.css
- path/to/source/js/script.js
This will then update your template "target" file with the updated filenames:
- path/to/target/template.html
To restore these you'll have to again pass the target and source files:
cachebust -r -s path/to/source/css/style.css,path/to/source/js/script.js -t path/to/target/template.html
You can run cachebust --help
for more options.
-V, --version output the version number
-s, --source [files] source file(s) to be fingerprinted; comma seperated file list
-t, --target [files] target file(s), template files that need the fingerprinted asset file names; comma seperated file list
-r, --restore copies the backup file(s) back to the original; backup file(s) are removed.
-h, --help output usage information
Ensure that the file lists for -s
or --source
and -t
and --target
are comma seperated.
-s dir/path/file.ext,dir/otherpath/otherfile.ext
etc.
You can pass in one file (no comma, or mutliple files for both source and target).
You may also specify a single file, without a comma.
The MIT License (MIT)
FAQs
A simple cache buster
The npm package @sparkbox/cachebust receives a total of 0 weekly downloads. As such, @sparkbox/cachebust popularity was classified as not popular.
We found that @sparkbox/cachebust demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.