Developer builds npm package to sort filenames into rule-based buckets
A developer released 'classify-filename', a lightweight npm package, after failing to find an existing tool that could sort filenames into categorized buckets based on custom rules. The library accepts a list of filenames and user-defined rules using regex or strings, and groups files into named sections with a fallback bucket for unmatched entries. It includes natural sorting within each bucket, case-insensitive matching by default, and a debug mode that maps each file to its assigned section. Built with TypeScript and dual CJS/ESM output via tsup, the package weighs around 2 KB minified and has zero runtime dependencies. Features like glob support, file-metadata rules, and a CLI are planned for upcoming versions.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in