
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@eklingen/file-hash-cache
Advanced tools
Simple SHA-1 hash cache for tracking file changes. Cache is saved to disk.
Init the cache.
Optional arguments:
defaultKey = 'file'; used throughout to categorize groups of filescacheFile = '.hash-cache.json'; filename of the cache on diskcacheRoot = process.cwd(); root where to place the cache on diskprojectRoot = process.cwd(); root from where relative file paths are calculatedimport FileHashCache from '@eklingen/file-hash-cache'
const fileHashCache = new FileHashCache()
Update a file entry in the cache (existing cache will automatically be loaded from disk):
fileHashCache.updateEntry(filename = 'readme.md', key = 'readme-files', encoding = 'utf-8')
And finally, save the cache to disk:
fileHashCache.save()
To force load the cache:
This loads the full cache. Pass a key to initialize the group if it doesn't exist yet in the cache.
fileHashCache.load('readme-files')
To check if a file hash has changed as compared to the value in the cache: This always compares file contents since the output can differ after writing it to a file.
const hasChanged = fileHashCache.fileHasChanged(file = 'readme.md', key = 'readme-files', encoding = 'utf-8')
To compare the hash of two files, regardless of the cache: This always compares file contents since the output can differ after writing it to a file.
const isIdentical = fileHashCache.compareFiles(firstFilepath = 'somewhere/readme.md', secondFilepath = 'else/readme.md', encoding = 'utf-8')
None.
Copyright (c) 2024 Elco Klingen. MIT License.
FAQs
Simple SHA-1 hash cache for tracking file changes.
We found that @eklingen/file-hash-cache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.