A command-line tool and library for formatting, searching, and rewriting JavaScript code, inspired by gofmt.
jsfmt is a command-line tool and Node.js library for formatting, searching, and rewriting JavaScript code. It automates code style enforcement, enables AST-based code transformations, and helps developers maintain consistent codebases. Inspired by Go's gofmt, it provides a unified workflow for JavaScript code manipulation.
JavaScript developers and teams who want to automate code formatting, refactor legacy code, or enforce coding standards across projects. It's particularly useful for projects transitioning between libraries or modernizing codebases.
Developers choose jsfmt because it combines formatting, searching, and rewriting in a single tool with a simple CLI interface. Unlike standalone formatters, it enables sophisticated code transformations through AST pattern matching, making it ideal for large-scale refactoring tasks.
For formatting, searching, and rewriting JavaScript.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Combines formatting, AST searching, and rewriting in a single CLI tool, reducing toolchain complexity as shown in the unified interface for commands like --rewrite and --search.
Enables precise code transformations with pattern-matching rewrite rules, such as converting _.reduce to native reduce, ideal for library migrations.
Offers plugins for Vim, Atom, Emacs, Sublime, and tasks for Grunt/Gulp, facilitating seamless workflow integration per the Links section.
Reads formatting options from .jsfmtrc files and supports esformatter plugins, allowing teams to customize styles and extend functionality.
The --ast and --save-ast options are marked as experimental and may be removed, introducing instability for AST-dependent workflows.
Relies on esformatter for formatting, which has fewer updates and community traction compared to tools like Prettier, limiting modern feature support.
Rewrite rules use a non-standard pattern language (e.g., 'a.slice(b, len(a) -> a.slice(b)'), requiring deep AST knowledge and prone to errors during refactoring.
Lacks native integration in popular editors like VS Code and no built-in TypeScript support, making it less appealing for contemporary JavaScript projects.