hash-of-directory
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

hash-of-directory

Calculate the hash of a directory and its files.

Install

yarn add hash-of-directory

Usage

import { hashOfDirectory } from "hash-of-directory";

const dir = path.join(__dirname, "example");

const hash = await hashOfDirectory(dir);

// you can also specify a specific encoding and algoritm
// defaults to sha256 algoritm & base64 encoding

const hash2 = await hashOfDirectory(dir, {
  algorithm: "sha1",
  encoding: "hex",
});

Readme

Keywords

none

Package Sidebar

Install

npm i hash-of-directory

Weekly Downloads

9,466

Version

1.0.1

License

MIT

Unpacked Size

20.8 kB

Total Files

22

Last publish

Collaborators

  • kesla