Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/otbe/snapshot-dir
Takes a snapshot of a folder
https://github.com/otbe/snapshot-dir
Last synced: about 2 months ago
JSON representation
Takes a snapshot of a folder
- Host: GitHub
- URL: https://github.com/otbe/snapshot-dir
- Owner: otbe
- License: mit
- Created: 2017-04-28T21:36:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-04-29T16:05:30.000Z (over 7 years ago)
- Last Synced: 2024-11-21T12:45:14.976Z (about 2 months ago)
- Language: TypeScript
- Size: 63.5 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# snapshot-dir
[![Build Status](https://travis-ci.org/otbe/snapshot-dir.svg?branch=master)](https://travis-ci.org/otbe/snapshot-dir)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
```
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
```
Compares a given ```path``` with a given ```currentSnap``` and returns a [deep-diff](https://www.npmjs.com/package/deep-diff#simple-examples) result object, which is undefined for no diff or a changeset.### snapshotSync
Same as ```snapshot``` but sync.### snapshotCompareSync
Same as ```snapshotCompare``` but sync.