replace
replace copied to clipboard
Results from JS API
If you are calling replace as a function it would be cool to get information back about what was replaced as it runs or after it completes.
Perhaps return a results object or take an options callback that reports back file and occurrence information as it runs.
+1
+1 For this to be feasible, the function should receive a callback as second parameter. This would not only make the function properly asynchronous (stick to standards), but would allow to:
- send errors back instead of throwing them which is dangerous in an async environment (no try/catch mechanism from the calling function).
- send the response back under an asynchrounous scenario.
+1