
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
lucy-dirsum
Advanced tools
Create an md5 digest of all content inside a directory. Uses streams to avoid reading all data in memory.
Create an md5 digest of all content inside a directory.
Part of Lucidity project.
npm install lucy-dirsum --save
Returns an (async) md5 digest of all content inside a directory. The ignore
function can be used to ignore files. It receives a local path to directory and
filename. For example, scanning '/some/directory', the file
'/some/directory/foo/bar.txt' is checked by calling the ignore function with ( 'foo/bar.txt', 'bar.txt' )
. Returning true ignores the file. Default ignore
function is to ignore files starting with a dot ('.').
The hashing algorithm includes file names (and thus detects empty directory and file move) and does not read large files in memory (it uses read streams). Speed is directly proportional to fs.createReadStream (36s for 12G of data on i7 cpu).
const dirsum = require ( 'lucy-dirsum' )
dirsum
( '/some/directory'
, function ( err, digest )
{ if ( err )
{ // ...
}
else
{ console.log ( `Hex digest for '/some/directory' is '${ digest }'.` )
}
}
, function ( path, filename )
{ return /^\./.exec ( filename )
|| /^info\.txt/.exec ( path ) // ignore info.txt at root
}
)
npm test
Please use 'jessy style'.
Add unit tests for any new or changed functionality.
FAQs
Create an md5 digest of all content inside a directory. Uses streams to avoid reading all data in memory.
The npm package lucy-dirsum receives a total of 70 weekly downloads. As such, lucy-dirsum popularity was classified as not popular.
We found that lucy-dirsum 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
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.