Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@jimdo/md5-loader
Advanced tools
#md5-loader
The md5 loader lets you import
the checksum of a directory as a variable.
In a redux app there is the chance you want to persist the store or parts of it in the localStorage
/sessionStorage
and rehydrate your app on page-reload or a later session.
However this means you may get very old data from the store if your app has changed significantly in the mean time. Therefore you need some kind of versioning in the localStorage/sessionStorage.
The md5-loader allows you to get the md5-checksum of e.g. your reducer
-directory, so everytime a reducer changes, the version for the store will change. This allows you to check on rehydration if the versions match and reject or migrate the stored state.
As webpack tries to import content before passing them to the loader you cant specify the directory like you would be used in a normal loader.
Instead you should use the md5-loader
inline and specify the path
to the directory as a loader query-parameter.
As there is no actual file required the loader also does not get the context
in which it is running, thus you must specify the path to the directory absolute from the root of your project (where your node_modules live etc.).
var checksum = require('md5-loader?path=some/path/from/root/of/project!');
console.log(checksum);
// logs the md5-checksum of the above directory
FAQs
returns md5 hash of a specified path
The npm package @jimdo/md5-loader receives a total of 7 weekly downloads. As such, @jimdo/md5-loader popularity was classified as not popular.
We found that @jimdo/md5-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.