fastmod Command Examples

A fast partial replacement for the codemod tool, replace and replace all in the whole codebase. Regexes are matched by Rust regex crate. More information: https://github.com/facebookincubator/fastmod.

fastmod {{regex_pattern}} {{replacement}}

fastmod --ignore-case {{regex_pattern}} {{replacement}} -- {{path/to/file path/to/directory ...}}

fastmod {{regex}} {{replacement}} --dir {{path/to/directory}} --iglob {{'**/*.{js,json}'}}

fastmod --fixed-strings {{exact_string}} {{replacement}} --extensions {{json,js}}

fastmod --accept-all --fixed-strings {{exact_string}} {{replacement}}

fastmod --accept-all --print-changed-files --fixed-strings {{exact_string}} {{replacement}}