![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
file-freezer
Advanced tools
automatically prevent certain file edits from slipping past human code review
Table of Contents |
---|
You want this if:
Example:
This approach is conceptually similar to a Merkle tree or blockchain, in that it signs each file with a comment hash such that a prior change would alter subsequent signatures, raising a red flag on the next check that either file or sequence integrity was not preserved.
/your/project> node file-freezer --help
-f, --files [value] glob string passed to npmjs.org/glob to fetch file sequence
(defaults to "./migrations/**/*.@(js|sql)")
-h, --help Output usage information
-r, --readOnly Whether to write signatures to files or error in their absence.
Useful for tests (disabled by default)
-u, --uninstall removes all signature comments from all files found via --files
(disabled by default)
-s, --silent log nothing out (disabled by default)
require('file-freezer')({
// same option flags as cli above; example:
files:'./migrations/**/*.@(js|sql)'
})
file-freezer
token hash it detectsfile-freezer
hash
readOnly
is false
, writes the hash in a comment atop the sourcereadOnly
is true
, logs and exits with code 1file-freezer
hash, logs and exits with code 1Attaching this to your tests with --readOnly
will catch missing signatures and errant edits to desirably immutable files / sequences even if human reviewers do not.
--readOnly
option so it defaults to false
and signs new files)FAQs
automatically prevent certain file edits from slipping past human code review
The npm package file-freezer receives a total of 6 weekly downloads. As such, file-freezer popularity was classified as not popular.
We found that file-freezer 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
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.