
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
fast-replace
Advanced tools
fast-replace is a command line utility that recursively finds and replaces regex at blazing fast speeds
.gitignore by defaultnpm install -g fast-replace
Replace all occurrences of foo with bar recursively starting from the current directory:
fast-replace 'foo' 'bar'
Preview replacements without modifying any files:
fast-replace 'foo' 'bar' -D
Replace only in mock.js and the tests/ directory:
fast-replace 'foo' 'bar' mock.js tests/
Replace snake_case_words with kebob-case-words:
fast-replace '(\S)_(\S)' '$1-$2'
Replace only in files with names matching *.js or *.jsx:
fast-replace 'foo' 'bar' -g '*.js' '*.jsx'
Replace only in files not in the vendors/ directory:
fast-replace 'foo' 'bar' -G 'vendors/**'
fast-replace <from> <to> [paths...]
<from> Regex pattern to match
<to> String to replace matched pattern, use $1, $2, etc to
match regex groups
[paths...] Directories or files to recursively search
Options:
--dryrun, -D print replacements without making changes [boolean]
--quiet, -q don't log to console [boolean]
--unrestricted, -u don't respect .gitignore [boolean]
--ignoreCase, -i search with case insensitively [boolean]
--fixedStrings, -F treat pattern as a literal string instead of a regular
expression [boolean]
--globs, -g include files / directories matching the given glob
[array]
--ignoreGlobs, -G exclude files / directories matching the given glob
[array]
--ignoreLargeFiles, -L Ignore files larger than 50KB in size [boolean]
--help Show help [boolean]
--version Show version number [boolean]
const fastReplace = require('fast-replace');
fastReplace('from', 'to', { /* options, matches CLI */ }).then(changedFiles => {});
FAQs
Recursive find and replace command line utility
We found that fast-replace demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.