stc-replace
Version:
Content replace for stc, Support string & regular expression
30 lines (22 loc) • 496 B
Markdown
# stc-replace
Content replace for stc, Support string & regular expression
## Install
```sh
npm install stc-replace
```
## How to use
```
var replace = require('stc-replace');
//string replace
stc.workflow({
replace: {plugin: replace, include: [/\.(js|css|html)/, {type: 'tpl'}], options: {
'xxx.com': 'yyy.com'
}}
})
//regular replace
stc.workflow({
replace: {plugin: replace, include: [/\.(js|css|html)/, {type: 'tpl'}], options: [
[/www\.(com|cn)/, 'yyy.com']
]}
})
```