fix-mod-date
fix-mod-date
is a CLI tool which reads & updates the modification date of various file types by parsing their contents. Of course it does not work with any file because the date must be saved in the file somehow.
fix-mod-date
can also be used on directories to update their modification times based on the latest file it contains.
It can happen that the modification date of a file is incorrect for various reasons, ex. if a file has been copied without preserving modification date, such as when it is moved from one filesystem to another.
compatibilty
Node.JS >= 10 and PowerShell on Windows (since Windows Server 2008 & Windows 7)
Note: run export NODE_NO_WARNINGS=1
before fix-mod-date
to avoid fs.promises API ExperimentalWarning on Node 10.x.
install
npm install -g fix-mod-date
use
fix-mod-date /some/file.ai /some/other/file.ai /some/directory
options
--version
: outputs versiont
or--test
: test mode. date will not be modified.v
or--verbose
: verbose logging.q
or--quiet
: no output at all.r
or--recursive
: recursive level for processing directories. default =1
i
or--ignore
: file names to ignore. default = [] but OS files .DS_Store, .Spotlight-V100, .Trashes, ehthumbs.db and Thumbs.db are ignored by default.f
or--fallback
: use file OS modification time if time not found in file contents.d
or--directory
: update the directories modification time based on the files it contains.
supported file types
ai
(Adobe Illustrator)psd
(Adobe Photoshop)eps
(Encapsulated Postscript)aep
(Adobe After Effects project)jpg/jpeg
needs EXIF datatiff
needs EXIF dataheic
needs EXIF dataheif
needs EXIF datawebp
needs EXIF datamp4/mpg4
(MPEG-4 Part 14)m4a
(MPEG-4 Part 14 Audio)zip
(ZIP compressed file)
develop
setup
git clone https://github.com/didrip/fix-mod-date && cd fix-mod-date
npm install
npm run build
npm link
live changes
npm run dev
test
npm run test
dependencies
toolchain
Bundler | Webpack 5 | live transpiler (to dist) + support additonal option node features such as top level await which is not transpiled (yet) by babel itself. | |
Transpiler | Babel 7 | code transpiler so experimental ES features can be used (ex : optional chaining operator). | |
Test runner | Mocha 8 | describe and organize tests. | |
Assertion library | Chai 4 | CLI runner wrapper. | |
Linter | ESlint 7 | code linter. | |
CI | Travis | continuous integration. |