pypre
v3.0.0
Published
An npm binary package for preconfiguring files using placeholder syntax.
Downloads
42
Maintainers
Readme
pypre v3.0.0
pypre is an npm binary package for preconfiguring files.
install
npm install -g pypreusage
create package.json file in the directory where you have files to preconfigure:
npm init -ygo to the root of your project and run :
npm linkthen back to the child directory, run:
npm link [name-of-your-parent-project]navigate to the directory where you have files you want to preconfigure and create a single .pypre.json file containing the keys:
{
"filename": "yourfilename",
"vars": {
"var1": "value1",
"var2": "value2",
...
}
}add a [yourfilename].preconfig.[some-extension] file, with the following placeholders whereever you need them
$preconfigure_[here include the name of your placeholder, without the brackets and only letters]$in the child package.json add:
"scripts": {
"pypre": "pypre && python3 pypre.py && rm pypre.py"
}run pypre where [yourfilename].preconfig.[some-extension] is
npm run pyprethis should generate a configured file with the name specified in your .pypre.json and placeholders filled in
