Skip to content

coderaiser/ischanged

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ischanged NPM version Dependency Status Build Status Coverage Status

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.

Install

npm i ischanged --save

Hot to use?

const ischanged = require('ischanged');

const is = await ischanged('/etc/passwd');
// returns
true

await ischanged('/etc/passwd');
// returns
false

How it works?

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:

  • should be called by hand;
  • could detect modifications after restart of application;

License

MIT