1.0.21 • Published 4 years ago

@urbanantics/environme v1.0.21

Weekly downloads
1
License
ISC
Repository
-
Last release
4 years ago

Description :

http://environ.me

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

1.0.21

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.9

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago