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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.2
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.2
    3
  • 1.1.1
    0
  • 1.1.0
    0
  • 1.0.2
    0

Package Sidebar

Install

npm i snapshot-dir

Weekly Downloads

3

Version

1.1.2

License

MIT

Last publish

Collaborators

  • otbe