https://github.com/voltraco/fs-changes
A persistent file system changes monitor, backed by leveldb
https://github.com/voltraco/fs-changes
changes filesystem leveldb monitoring
Last synced: 3 days ago
JSON representation
A persistent file system changes monitor, backed by leveldb
- Host: GitHub
- URL: https://github.com/voltraco/fs-changes
- Owner: voltraco
- License: mit
- Created: 2016-04-03T17:10:49.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-23T15:59:01.000Z (over 8 years ago)
- Last Synced: 2025-07-09T14:48:56.102Z (5 days ago)
- Topics: changes, filesystem, leveldb, monitoring
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 11
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SYNOPSIS
A simple cross platform leveldb backed file system watcher.# DESCRIPTION
Watches the file system recursively, stores a snapshot in leveldb, compares
and emits changes in the form of new-line-delimited json. Also emits events
for changes made since the process was last run.# USAGE
### fsch(1)
Used as a user command.```bash
fsch [path/to/cache]
```### fs-changes(3)
Used as a library.```js
const changes = require('fs-changes')const opts = {
pattern: /\.txt$/,
dir: './files',
cache: '.cache'
}changes(opts, events => { // returns `events` after doing initial diff
events.on('added', path => console.log({ path, type: 'added' }))
events.on('modified', path => console.log({ path, type: 'modified' }))
events.on('removed', path => console.log({ path, type: 'removed' }))
}) // returns an instance of levelup
```