Skip to content

ToddSmithSalter/ttt-date-prefixer

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

Todd's Tiny Tools — Date Prefixer

A tiny CLI tool to parse dates from filenames and prefix in a sortable format.

Installation

Not yet published to npm. Clone this directory and run the following to test:

npm install
npm link

How it works

This tool walks the directory and it's subfolders from where the tool is run. Each filename is parsed and dates are prefixed. Files who already start with 4 digits (simplistic assumption of year-first formatting) are skipped.

Date formats parsed

  • MMM DD YYYY, i.e. Jan 13 2020
  • MMMM DD YYYY, i.e. Sept 3 2019
  • YYYY-MM-DD, i.e. 2020-02-14

Prefixed format

Date strings are reformatted to YYYY-MM-DD format for simple chronological sorting.

About

Prefix all files in a directory with YYYY-MM-DD formatted date

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published