EndemolShineGroup/serverless-test-utils

View on GitHub
src/util/replaceTextInFile.ts

Summary

Maintainability
A
0 mins
Test Coverage
import fs from 'fs';

export default (filePath: string, subString: string, newSubString: string) => {
  const fileContent = fs.readFileSync(filePath).toString();
  fs.writeFileSync(filePath, fileContent.replace(subString, newSubString));
};