npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

grumptech-fs-hasher

v1.1.0

Published

Generates hash digests of file system folders and their contents.

Downloads

5

Readme

GrumpTech-FS-Hasher

A JavaScript node module for for producing message digests of files and directories. The message digest of a directory is computed as the hash of the message digests of all of the contents of the directory.

Change Log

The change history can be viewed here

Security Policy

Please refer to our security policy for information on which versions are receiving security updates and how to report security vulnerabilities.

Installation

npm install grumptech-fs-hasher

Basic Usage

Loading the module in NodeJS

const fsHasher = require('grumptech-fs-hasher');

Testing the module in NodeJS       Example usage is shown in the file: ./test/testscript.js

npm run test-rel

The module exports two objects:

  1. HASH_ALGORITHMS: An enumeration of supported hashing algorithm.
  2. FSHasher: Object to perform the hashing and reporting.

FSHasher API

The FSHasher object provides the interface below

Version: Read-only property for the version of the hasher module.       @return {string}

IsBusy: Read-only property indicating that the object is busy performing an operation.       @return {boolean}

Algorithm: Read-only property of the current hashing algorithm. Default: 'sha256'       @return {string}

Source: Read-only property for the source(s) to perform the hashing.       @return {string | string[]}:

Build: Constructs a hierarchy of files and directories to be hashed.       @parm {string | string[]} [source]       @return {Promise(boolean)} - A promise that when resolved will indicate if the file system heirarchy was built or not. true if built. false otherwise.

Compute: Generate a message digest of the source (and all child items).       @param {string} - A string representing the hashing algorithm to use. HASH_ALGORITHMS is an enum of common algorithms.       @return {Promise(string)} - A promise that when resolved will provide a string representing the overall hash of the root source. If the hierarchy has not been built or the root source is busy, the promise will resolve to and empty string

Report: Build a report of the file system hierarchy with the results of the hashing.       @return {Promise(string)} - A promise that when resolved will provide a string containing a CSV delimited report. If the hierarchy has not been built or the root source is busy, the promise will resolve to an empty string.       CSV Format:       Field #1: Type - '(D)'-Directory, '(F)'-File, '(B)'-Batch       Field #2: Source - Path of the File System object. Will be prepended with spaces corresponding to the depth of the result item.       Field #3: Digest - Message digest of the item. If it has not been computed, it will default to undefined.

FindDuplicates: Finds duplicate file system objects.       @return {Promise(Map{key:digest, value:source[]))} - A promise that when resolved will provide a map/dictionary. The key of the dictionary will be "common" message digest and the value will be an array of strings containing the sources sharing the digest. Unique items will not be specified in the result.

License

Refer to LICENSE.md for information regarding licensincg of this source code.