I've tried to write a function to replace string in a directory. And I founded a performance library written in Rust. https://github.com/TankerHQ/ruplacer, but the documentations only works in CLI. Now I can not custom the library to a function like that:
fn replace(path, foo, bar) {
ruplacer(path, foo, bar)
}