Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
metalsmith-fingerprint-ignore
Advanced tools
A fork of metalsmith-fingerprint that discards the original file
A fork of metalsmith-fingerprint that discards the original file
This plugin fingerprints your files for easy and reliable cache-busting. Since you're not going to use the original, this fork discards it by default (but still allows you to keep it if you want to).
This plugin normalizes paths on windows using slash so that in most cases builds will work on both windows and *nix without any changes to the paths. Check the docs for slash for more details.
npm install metalsmith-fingerprint-ignore
Say you want to fingerprint the file css/index.css
:
Metalsmith(__dirname)
.use(fingerprint({ pattern: 'css/index.css' }))
.use(template({ engine: 'handlebars' }))
.build()
The plugin does three things:
index.css
with a fingerprinted filenamefingerprint
object on the Metalsmith metadataindex.css
fileThe fingerprint
object is accessible from the Handlebars template:
<link href="{{ fingerprint.[css/index.css] }}" rel="stylesheet" type="text/css" />
And the template renders the fingerprinted filename:
<link href="css/index-724af9dd72a48c18dd570790c2445fb4.css" rel="stylesheet" type="text/css" />
You can pass options to metalsmith-fingerprint-ignore
with the Javascript API or CLI. The options are:
String|Array<String>
: A pattern to filter source files. The path is relative to your source
. Required.
{
"plugins": {
"metalsmith-fingerprint-ignore": {
"pattern": "css/index.css"
}
}
}
Boolean
: Keep the original file. Setting it to true will keep the original file and create a fingerprinted version as well. Default false
. Optional.
{
"plugins": {
"metalsmith-fingerprint-ignore": {
"pattern": "css/index.css",
"keep": "true"
}
}
}
Metalsmith fingerprint does not discard the original file after fingerprinting. So when fingerprinting a large collection of files you'll have to manually ignore them all. Unfortunately the only predictable difference between the original and the fingerprinted file is the dash before the fingerprint.
An issue was opened to address this, but closed as wontfix
. So this fork is based on the PR by callum, which can be used by those who would still like this functionality.
Thanks to:
MIT.
FAQs
A fork of metalsmith-fingerprint that discards the original file
The npm package metalsmith-fingerprint-ignore receives a total of 22 weekly downloads. As such, metalsmith-fingerprint-ignore popularity was classified as not popular.
We found that metalsmith-fingerprint-ignore 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.