@brillout/replace
Global installation
pnpm add -g @brillout/replace
You can now run the CLI ($ replace) and API (import { replace } from '@brillout/replace') anywhere.
CLI
Replace oldString with newString:
replace oldString newString
Replace old string with new string:
replace "old string" "new string"
Replace old "string" with new "string":
replace "old \"string\"" "new \"string\""
Show help:
replace --help
[!NOTE] For strings with complex shell escaping, we recommend using the API instead.
API
import { replace } from '@brillout/replace'
replace('\!foo', '\!bar')