Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
fingerprinting
Advanced tools
Readme
Fingerprinting is a cache-busting technique which allows you to expire files when they actually change this is done by altering the filenames of the files. This way you can set far future expire headers without having to worry that your users might see stale or old files. Providing you with best of 2 worlds, cached assets for increased performance with sacrificing your ability to instantly modify files.
The module is released in the public npm registry and can be installed by running:
npm install --save fingerprinting
The fingerprinting
module is exposed as a single function that generates the
new filenames for your files. In all examples we assume that you've already
required the module as followed;
'use strict';
var finger = require('fingerprinting');
The exported finger
function accepts the following arguments:
contents
option is provided (please do note that reading is
done using a sync fs method).{hash}.{suffix}.{ext}
.md5
.false
.production
generates a min
suffix while a mising or development generates a dev
suffix. Defaults to
NODE_ENV
.fs.readFileSync
within the code. It can be either a string or Buffer.The function returns an object with 2 keys:
true
this will contain the filename
for your source map file.var fs = require('fs');
fs.readFile(__dirname + '/index.js', function (err, buffer) {
if (err) throw err;
var print = finger('index.js', {
content: buffer
});
console.log('print:', print.file); // 167f581dd914ba9d3d2e6c8820a5caa6.dev.js
});
MIT
FAQs
Produce a unique string for any given resource, commonly used in cache busting practices.
The npm package fingerprinting receives a total of 1,120 weekly downloads. As such, fingerprinting popularity was classified as popular.
We found that fingerprinting 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.