A basic Node.js CLI app for common file operations.
Included so far:
- Find and replace
- Prepending
- Appending
npm install @nrademacher/file-ops-cli
npm install -g @nrademacher/file-ops-cli
file-ops <operation> <args> <file>
Note: Globbed file specifications (e.g. *.js
or src/**/*.js
) must be in quotes to prevent automatic glob expansion.
file-ops fnr '<old>' '<new>' <flags> '<file>'
--silent
,-s
- Will not log individual processed files to console
file-ops prepend '<text>' <flags> '<file>'
--silent
,-s
- Will not log individual processed files to console
--unique
,-u
- Will skip file if file already includes input string
file-ops append '<text>' <flags> '<file>'
--silent
,-s
- Will not log individual processed files to console
--unique
,-u
- Will skip file if file already includes input string
- Add better and prettier logging
- Add quality-of-life CLI features
-
--help
flag
-
- Add more operations
- Write tests