es-replace-text
v0.1.1
Published
Simple node module to replace text given regexp and transform with function.
Downloads
9
Readme
###ReplaceText
// example
var replaceText = require('es-replace-text');
// replaces every text 'foo' in ./someDir/**/*.js with 'bar'
const source = path.resolve(__dirname, 'someDir');
replaceText.replaceInFileRecursive(source, {
keyword: /foo/i,
filetype: /*\.js$/,
transform: function(match) {
return 'bar';
}
})