Last 12 weeks · 0 commits
4 of 6 standards met
I'm using (specifically, the programmatic API) to _prepend_ a banner to a bunch of files. There are myriad packages to do this sort of thing, but they either a) expect the data to be in , b) are plugins for a task runner like , c) unmaintained, or d) hopelessly broken and overengineered. If you have written a standalone tool to do this, please let me know! This is what "prepend to file" looks like: Whereas "append to file" looks like this: This isn't quite obvious. I had to play around with regexes to arrive at "append", which works _opposite_ of how I'd expect--I'd expect a banner after every line (which can be accomplished with ). Anyway. I'm thinking supporting and flags would be more user-friendly. But since it's not really a "replace" operation, maybe it's out-of-scope for this module? Providing sugar functions like or might be OK, except that a user may want to append/prepend _and_ find/replace in a single operation-- accepts an array, after all.
Repository: sindresorhus/replace-in-files-cli. Description: Replace matching strings and regexes in files Stars: 179, Forks: 12. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Topics: cli-app, command-line-tool, nodejs, npm-package, replace, replace-in-files, replace-text, search-and-replace. Latest release: v4.0.0 (11mo ago). Open PRs: 0, open issues: 0. Last activity: 11mo ago. Community health: 85%. Top contributors: sindresorhus, boneskull, mesqueeb, Richienb, ritazoliveira, rivy.