ischanged

2018-10-23 admin

ischanged是什么

什么是ischanged,Is file changed check

ischanged使用教程帮助文档

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.

Install

npm i ischanged --save

Hot to use?

const ischanged = require('ischanged');
ischanged('/etc/passwd', (error, is) => {
    console.log(is);
    //true
    ischanged('/etc/passwd', (error, is) => {
        console.log(is);
        //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

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:电子书 iis7站长之家

文章标题:ischanged

回到顶部