Closed DVLP closed 2 years ago
Unfortunately I'm too busy to publish another NPM module of my own but what I'd suggest is breaking the project into 2 i.e. process-files and the current project replace-in-file. replace-in-file can load process-files as a dependency and pass string replacement as a processor. Processors can be expanded and return an object instead of a string so counting functionality can be preserved
Pushed fixes for the problems. The sync version was not plugged in and there were some leftovers after a refactor.
Thank you, released as 6.3.0
Thanks, great!
Instead of forking this project and creating a new one to process files I'm adding this PR to allow passing a custom processor function. When providing "processor" parameter it bypasses built-in string replacement functionality("from" and "to" parameters are ignored) to allow processing files with full flexibility of javascript in arbitrary functions.