older
v1.0.2
Published
Simple function to check if a file is older, useful for cache related operations.
Downloads
2
Readme
older
Simple function to check if a file is older, useful for cache related operations.
Installation
npm i older
Usage
import older from 'older';
Example
import older from 'older';
if(older('extracted.json', 'scraped.html')){ // if extracted.json is older than scraped.html
// scraped html is newer and contains updated data, extracted.json must be re-created
extractAndSaveData({from:'scraped.html', into:'extracted.json'});
}
Testing
npm run test