1.2.1 • Published 7 years ago

fsnap v1.2.1

Weekly downloads
9
License
MIT
Repository
github
Last release
7 years ago

fsnap

Linux Build Status Windows Build status Dependency Status devDependency Status

Diff filesystem snapshot results. Useful for file watch system.

Install

npm install --save fsnap

Usage

const fsnap = require('fsnap');

let s1 = fsnap.create(path);
let s2 = fsnap.create(path);
let result = fsnap.diff(s1, s2);

// do something...
console.log(result.deletes);
console.log(result.changes);
console.log(result.creates);

API Reference

Methods

fsnap.create(patterns, options)

  • patterns string|Array - See supported minimatch patterns.
  • options object - See the node-glob options.

create snapshot from the given patterns.

fsnap.diff(s1, s2)

  • s1 object - snapshot 1
  • s2 object - snapshot 2

Returns object

  • deletes array - path list of deleted files and directories.
  • creates array - path list of created files and directories.
  • chagnes array - path list of changed files and directories.

fsnap.simplify(result)

  • result object - the result of fsnap.diff

Simplify the diff result by remove files contains in the directory in the same result.

License

MIT © 2017 Johnny Wu

1.2.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago