@deg-skeletor/plugin-tokenreplace
v1.0.2
Published
A Skeletor plugin for replacing token strings within files
Downloads
3
Readme
Skeletor Token Replace Plugin
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.
Installation
Install this plugin into your Skeletor-equipped project via the following terminal command:
npm install --save-dev git+https://[email protected]/deg-skeletor/skeletor-plugin-tokenreplace.git
Configuration
This plugin passes its config
object directly to the replace-in-file
plugin. For full documentation, go here.
Example Configuration (single file)
{
files: 'path/to/sourceFile.txt',
from: /original content/g
to: 'replacement content'
}
Example Configuration (multiple files, single value, single replacement)
{
files: [
'path/to/sourceFileOne.txt'
'path/to/sourceFileTwo.txt'
],
from: /original content/g
to: 'replacement content'
}
Example Configuration (multiple files, multiple values, single replacement)
{
files: [
'path/to/sourceFileOne.txt'
'path/to/sourceFileTwo.txt'
],
from: [
/original content one/g,
/original content two/g
],
to: 'replacement content'
}
Example Configuration (multiple files, multiple values, multiple replacements)
{
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'
]
}
Configuration Options
files
Type: String
or Array
One or more source file paths.
from
Type: String
or Array
One or more values that will be replaced by the from
value(s).
to
Type: String
or Array
One or more values that will replace the to
value(s).