@urbanantics/environme v1.0.21
Description :
Environ Me is a utiliy tool that can be run from the command line, which helps you better organise your static files, by allowing you to separate out and group the parts that change, and hopefully get more of your application configuration into source control.
It gives you:
- a command line utility that can combine multiple files based on arguments and generate ouput files.
- an npm package that can be used within your own code to produce the same merge functionality
Installation
Stable version:
npm i -g @urbanantics/environme
Usage :
Simple Example
Environme uses the following convention to locate static files and update their content
Suppose I had the following 2 files:
static-page.template.html
<!DOCTYPE html>
<html>
<body>
<div>
<img src="{$ config.url $}"/>
</div>
</body>
</html>
static-page.props.yml
config:
url: https://www.petguide.com/wp-content/uploads/2019/05/meanest-cat-breeds-bengal.jpg
TEST:
url: https://www.petguide.com/wp-content/uploads/2013/05/pitbull.jpg
PROD:
url: https://www.petguide.com/wp-content/uploads/2013/02/dalmatian-11-475x421.jpg
Environme will look for files that have *.template in the name and then find the coresponding *.props.yml file, and use these 2 files to produce the corespondin output file
So say we have a file called static-page.template.html and props file called static-page.props.yml, and both are in the folder static-content, running the following command:
environme --path static-content/* --env PROD
will match:
static-content/static-page.template.html
static-content/static-page.props.yml
and produce the following file:
static-content/static-page.html
with the folowing content:
<!DOCTYPE html>
<html>
<body>
<div>
<img src="https://www.petguide.com/wp-content/uploads/2013/02/dalmatian-11-475x421.jpg"/>
</div>
</body>
</html>
environme --path static-content/* -env TEST
will produce
environme --path static-content/*
Community :
Having problems? want to contribute? email me@reubenhutton.com
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago