snapshot-dir
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

snapshot-dir

Build Status

Every now and then I need a little tool which takes a snapshot of a folder and compares it to an older one. Imagine we program a build/bundler tool which uses this technqiue to ensure integrity after changes to the core.

snapshot-dir exports four functions to generate and compare snapshots.

API

snapshot

snapshot(path: string): Promise<SnapshotResult>

Generates a snapshot from a given path. The result is an object with filenames as keys and hashs as values.

snapshotCompare

snapshotCompare(path: string, currentSnap: SnapshotResult): Promise<IDiff>

Compares a given path with a given currentSnap and returns a deep-diff result object, which is undefined for no diff or a changeset.

snapshotSync

Same as snapshot but sync.

snapshotCompareSync

Same as snapshotCompare but sync.

Package Sidebar

Install

npm i snapshot-dir

Weekly Downloads

1

Version

1.1.2

License

MIT

Last publish

Collaborators

  • otbe