This plugin replaces text content in one or more files or globs using replace-in-file. It is part of the Skeletor ecosystem. To learn more about Skeletor, go here.
Install this plugin into your Skeletor-equipped project via the following terminal command:
npm install --save-dev git+https://git@github.com/deg-skeletor/skeletor-plugin-tokenreplace.git
This plugin passes its config
object directly to the replace-in-file
plugin. For full documentation, go here.
{
files: 'path/to/sourceFile.txt',
from: /original content/g
to: 'replacement content'
}
{
files: [
'path/to/sourceFileOne.txt'
'path/to/sourceFileTwo.txt'
],
from: /original content/g
to: 'replacement content'
}
{
files: [
'path/to/sourceFileOne.txt'
'path/to/sourceFileTwo.txt'
],
from: [
/original content one/g,
/original content two/g
],
to: 'replacement content'
}
{
files: [
'path/to/sourceFileOne.txt'
'path/to/sourceFileTwo.txt'
],
from: [
/original content one/g,
/original content two/g
],
to: [
'replacement content one',
'replacement content two'
]
}
Type: String
or Array
One or more source file paths.
Type: String
or Array
One or more values that will be replaced by the from
value(s).
Type: String
or Array
One or more values that will replace the to
value(s).