# search-replace

> A simple tool to help you search/replace throughout a codebase.

Latest version **1.0.3** (published 2020-01-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install search-replace
pnpm add search-replace
yarn add search-replace
bun add search-replace
```

Provides the command `search-replace`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2020-01-08 |
| First published | 2019-11-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 118.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Bram Borggreve |
| Maintainers | beeman |
| Keywords | TypeScript, Package, Starter |

## Links

- npm: https://www.npmjs.com/package/search-replace
- Repository: https://github.com/beeman/search-replace
- Homepage: https://github.com/beeman/search-replace#readme
- Issues: https://github.com/beeman/search-replace/issues
- npm.io page: https://npm.io/package/search-replace

## Dependencies (3)

- [yargs](https://npm.io/package/yargs.md) ^15.0.2
- [globby](https://npm.io/package/globby.md) ^11.0.0
- [replace-in-file](https://npm.io/package/replace-in-file.md) ^5.0.0

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2020-01-08
- 1.0.2 — 2019-12-17
- 1.0.1 — 2019-11-25
- 1.0.0 — 2019-11-25

## README

# search-replace

![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/beeman/search-replace.svg)
![GitHub repo size](https://img.shields.io/github/repo-size/beeman/search-replace.svg)
![npm](https://img.shields.io/npm/dw/search-replace.svg)
![npm](https://img.shields.io/npm/dm/search-replace.svg)
![npm](https://img.shields.io/npm/dy/search-replace.svg)
![npm](https://img.shields.io/npm/dt/search-replace.svg)
![NPM](https://img.shields.io/npm/l/search-replace.svg)
![npm](https://img.shields.io/npm/v/search-replace.svg)
![GitHub last commit](https://img.shields.io/github/last-commit/beeman/search-replace.svg)
![npm collaborators](https://img.shields.io/npm/collaborators/search-replace.svg)

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

---
_Source: https://npm.io/package/search-replace · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
