recommend: https://github.com/Rabbitzzc/tiny-replace-files
import { replaceStringInFilesSync } from 'tiny-replace-files'
const options = {
files: 'src/targets/index.js',
from: 'test-plugin',
to: 'self-name',
}
# await
const result = replaceStringInFilesSync(options)
console.info(result)
/**
[
{
file: './ques2.md',
changed: true,
matchCounts: 1,
replaceCounts: 1
}
]
*/
Top comments (1)
It's useful, and very tiny....