Switch to using fs APIs for file reading and writing.