Developer releases npm tool to auto-generate aligned comment dividers in code

A developer frustrated with manually aligning comment-based section dividers in code files has published an open-source npm package called code-divider. The tool replaces lightweight inline markers like @reg and @sec with fully formatted, centered header blocks that consistently end at column 79. Users can run it from the command line, point it at a specific file or directory, or configure it to trigger automatically on save via editor extensions. The package supports over a dozen languages including TypeScript, Python, Go, Rust, and SQL, using each language's native comment syntax. Unlike editor snippets, the tool dynamically sizes the filler characters around each label so all headers remain uniform regardless of label length.
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