Skip to content

CLI tool which reads & updates the modification date of various file types by parsing their contents.

License

Notifications You must be signed in to change notification settings

capi1O/fix-mod-date

Repository files navigation

fix-mod-date NPM package version NPM downloads Build Status codecov.io

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

available on npm.

npm install -g fix-mod-date

use

fix-mod-date /some/file.ai /some/other/file.ai /some/directory

options

  • --version: outputs version
  • t 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 data
  • tiff needs EXIF data
  • heic needs EXIF data
  • heif needs EXIF data
  • webp needs EXIF data
  • mp4/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 Dependency Status

toolchain devDependencies Status

Bundler Webpack 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 Babel 7 code transpiler so experimental ES features can be used (ex : optional chaining operator).
Test runner Mocha Mocha 8 describe and organize tests.
Assertion library Chai Chai 4 CLI runner wrapper.
Linter ESlint ESlint 7 code linter.
CI Travis Travis continuous integration.

Licence License: MIT

MIT

About

CLI tool which reads & updates the modification date of various file types by parsing their contents.

Resources

License

Stars

Watchers

Forks

Packages

No packages published