elizabethsobiya/classify-filename — explained in plain English
Analysis updated 2026-05-18
Automatically sort uploaded documents into folders like invoices, contracts, and agreements.
Group a batch of files by naming pattern before processing them further.
Debug why a file landed in a particular bucket using the explain option.
Replace custom filename sorting logic with a single reusable function.
| elizabethsobiya/classify-filename | 0labs-in/vision-link | adarsh-me/image-sdk | |
|---|---|---|---|
| Stars | 4 | 4 | 4 |
| Language | TypeScript | TypeScript | TypeScript |
| Setup difficulty | easy | moderate | easy |
| Complexity | 1/5 | 3/5 | 2/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
classify-filename is a small JavaScript and TypeScript library that takes a list of filenames and sorts them into named groups based on rules you define. Instead of writing your own logic every time you need to organize files by name, you hand it a list of filenames and a list of buckets, and it puts each file into the right bucket. Each bucket has a name and a rule for matching filenames to it. A rule can be a plain piece of text to search for inside the filename, a regular expression pattern, or your own custom function that checks the filename however you like. You can also combine several of these rule types together for one bucket. The order of your buckets matters: the first bucket whose rule matches a filename is the one that file goes into, so you should put your narrowest, most specific rules first and your broader, catch-all rules last. Files that do not match any bucket land in a default group called uncategorized, though you can change that name or turn it off entirely. The library also supports putting a single file into more than one bucket if you want that behavior, and it sorts the filenames within each bucket in a way that treats numbers naturally, so a file numbered 2 comes before one numbered 10. There is also a debugging option that shows you exactly which bucket each filename was matched to and why. The project has no external dependencies and is installed through npm. The author positions it as a small, focused replacement for writing the same file sorting logic by hand every time, since a basic filter only gives you one group at a time rather than multiple named, prioritized buckets with a fallback. As of this version it does not support glob patterns or sorting by file size or date, and it has no command line interface, only use as a code library. The project is released under the MIT license.
A tiny library that sorts a list of filenames into named groups based on text, pattern, or custom matching rules.
Mainly TypeScript. The stack also includes TypeScript, Node.js.
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
double-check against the repo, no cap.