Package Exports
- variable-replacer
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (variable-replacer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-variable-replacer
The simplest templating engine: replace variables in files
Templating language
Surround variables names by percents. Supports nested variables Works with any text file.
the value of var1 variable is: %var1%
the value of the key1 attr of var2 is %var2.key1%Usage
Command line
npm install -g variable-replacervariable-replacer sourcepath1 [sourcepath2 sourcepath3] destpath --data=datasource.json [--data-myvarname=value]Node JS
npm install innosetup-compilerrequire('variable-replacer')({
source: 'source/path',
dest: 'dest/path',
dataSource: 'data.json',
inlineData: {
var1 : 'val1',
var2 : {
key1: 'val2'
}
}
})Options
options.source (Mandatory)
Mandatory Type: string or array of string Note: glob pattern supported
Files to process (input files)
options.dest
Mandatory Type: string
Destination file or directory, where output file will be written.
options.dataSource
Optional Type: string or array of string
Path(s) of json file(s) containing source of data for variable replacement.
options.inlineData
Optional Type: Object
Inline source of data for variable replacement
options.verbose
Optional Type: boolean
Print log messages to console