aged
Small utility returning grunt file filter by last modified age
I described the motivation behind this little filter in Aged to Perfection blog post.
install
npm install aged --save-dev
use
n - positive numberunits - time units: 'days', 'hours', 'minutes', etcverbose - print filename if file is too young
aged can be used to define different metrics to run on different files depending on their age. For example, to pass older, stable source files through static grunt-complexity plugin you can:
// Gruntfile.js var aged = ;var files = 'Gruntfile.js' 'src/index.js'; grunt;
This will pass all files though less stringent fresh limits, while passing files older than 3 days though higher limits.
advanced
You can easily define the opposite filter to aged
{ var isAged = ; return { return !; };}
Any time units are allowed, see momentjs docs.
Small print
Author: Gleb Bahmutov Copyright © 2013
License: MIT - do anything with the code, but don't blame me if it does not work.
Spread the word: tweet, star on github, etc.
Support: if you find any problems with this module, email / tweet / open issue on Github