$ cnpm install ischanged
Check time of file modification. If it's changed probable file was changed to. There is no 100% assurance that is was, but it works much faster then check by hash.
npm i ischanged --save
const ischanged = require('ischanged');
const is = await ischanged('/etc/passwd');
// returns
true
await ischanged('/etc/passwd');
// returns
false
Ischanged saves time of file modification to file ischanged/<uid>/changes.json
in Temp directory and then checks whas it changed or not.
So it something like watch but:
MIT
Copyright 2013 - present © cnpmjs.org | Home |