https://github.com/beeman/search-replace
👀 A simple tool to help you search/replace throughout a codebase.
https://github.com/beeman/search-replace
cli developer-tools node search-replace typescript
Last synced: 3 months ago
JSON representation
👀 A simple tool to help you search/replace throughout a codebase.
- Host: GitHub
- URL: https://github.com/beeman/search-replace
- Owner: beeman
- License: mit
- Created: 2019-11-25T05:25:20.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-11-24T17:19:43.000Z (over 5 years ago)
- Last Synced: 2025-10-20T11:55:33.031Z (8 months ago)
- Topics: cli, developer-tools, node, search-replace, typescript
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/search-replace
- Size: 849 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# search-replace










A simple tool to help you search/replace throughout a codebase.
# Usage
Install globally if you want fast access to it.
```shell script
npm i -g search-replace
```
Search and replace all occurrences of `foo` with `bar`:
```shell script
npx search-replace -p foo,bar
```
You can specify multiple pairs:
```shell script
npx search-replace -p foo,bar -p Foo,Bar
```
It can also rename the files:
```shell script
npx search-replace -p foo,bar --rename-files
```
All options:
```shell script
Usage: search-replace -p foo,bar
Options:
--version Show version number [boolean]
-d, --dry Don't make any changes [boolean] [default: false]
-r, --rename-files Renames files [boolean] [default: false]
-f, --regexp-flags Flags to pass in to regexp [string] [default: "g"]
-w, --working-dir Working dir [string] [default: "."]
-p, --pair The search,replace pairs [array] [default: []]
-s, --separator Separator between search,replace [array] [default: ","]
-h, --help Show help [boolean]
```
## Credits
This is just a simple wrapper, the heavy lifting is done by [adamreisnz/replace-in-file](https://github.com/adamreisnz/replace-in-file).
## MIT License