A simple tool to help you search/replace throughout a codebase.
Last updated a year ago by beeman .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install search-replace 
SYNC missed versions from official npm registry.


GitHub code size in bytes GitHub repo size npm npm npm npm NPM npm GitHub last commit npm collaborators

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


Install globally if you want fast access to it.

npm i -g search-replace

Search and replace all occurrences of foo with bar:

npx search-replace -p foo,bar 

You can specify multiple pairs:

npx search-replace -p foo,bar -p Foo,Bar  

It can also rename the files:

npx search-replace -p foo,bar --rename-files  

All options:

Usage: search-replace -p foo,bar

  --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]


This is just a simple wrapper, the heavy lifting is done by adamreisnz/replace-in-file.

MIT License

Current Tags

  • 1.0.3                                ...           latest (a year ago)

4 Versions

  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 2
Dependencies (3)
Dependents (0)

Copyright 2014 - 2017 © |