# @urbanantics/environme

> Build Utility, string replace based on environment configuration

Latest version **1.0.21** (published 2020-08-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install @urbanantics/environme
pnpm add @urbanantics/environme
yarn add @urbanantics/environme
bun add @urbanantics/environme
```

Provides the command `environme`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.21 |
| Published | 2020-08-04 |
| First published | 2020-02-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 125.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | ReubenH |
| Maintainers | rhutton |

## Links

- npm: https://www.npmjs.com/package/@urbanantics/environme
- Homepage: https://environ.me
- Issues: https://github.com/urbanantics/environme/issues
- npm.io page: https://npm.io/package/@urbanantics/environme

## Dependencies (10)

- [clui](https://npm.io/package/clui.md) ^0.3.6
- [glob](https://npm.io/package/glob.md) ^7.1.6
- [chalk](https://npm.io/package/chalk.md) ^3.0.0
- [clear](https://npm.io/package/clear.md) ^0.1.0
- [mocha](https://npm.io/package/mocha.md) ^7.1.2
- [yargs](https://npm.io/package/yargs.md) ^15.3.1
- [figlet](https://npm.io/package/figlet.md) ^1.2.4
- [inquirer](https://npm.io/package/inquirer.md) ^7.0.4
- [minimist](https://npm.io/package/minimist.md) ^1.2.0
- [configstore](https://npm.io/package/configstore.md) ^5.0.0

## Recent versions

- 1.0.21 (latest) — 2020-08-04
- 1.0.20 — 2020-08-04
- 1.0.19 — 2020-05-22
- 1.0.18 — 2020-02-16
- 1.0.17 — 2020-02-11
- 1.0.16 — 2020-02-11
- 1.0.15 — 2020-02-11
- 1.0.14 — 2020-02-11
- 1.0.13 — 2020-02-11
- 1.0.12 — 2020-02-11
- 1.0.11 — 2020-02-10
- 1.0.10 — 2020-02-10
- 1.0.9 — 2020-02-10
- 1.0.8 — 2020-02-09
- 1.0.7 — 2020-02-09
- … 7 more at https://npm.io/package/@urbanantics/environme/versions

## README

<h1 align="center"> Environ Me </h1>
<p align="center">
  <b >Environ Me is a node.js library for bringing peace and order to your configuration and static content files</b>
</p>

<br>

## 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:
```bash
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
```html
<!DOCTYPE html>
<html>
<body>
 <div>
   <img src="{$ config.url $}"/>
 </div>
  </body>
</html>
```

static-page.props.yml
``` 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 **&ast;.template** in the name and then find the coresponding **&ast;.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:

```bash
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:

```html
<!DOCTYPE html>
<html>
<body>
 <div>
   <img src="https://www.petguide.com/wp-content/uploads/2013/02/dalmatian-11-475x421.jpg"/>
 </div>
  </body>
</html>
```

 <div>
   <img src="https://www.petguide.com/wp-content/uploads/2013/02/dalmatian-11-475x421.jpg"/>
 </div>

```bash
environme --path static-content/* -env TEST
```
will produce

 <div>
   <img src="https://www.petguide.com/wp-content/uploads/2013/05/pitbull.jpg"/>
 </div
  
  
and running the command with no --env will produce the default

```bash
environme --path static-content/*
```

 <div>
   <img src="https://www.petguide.com/wp-content/uploads/2019/05/meanest-cat-breeds-bengal.jpg"/>
 </div
 

## Community :

Having problems? want to contribute? email me@reubenhutton.com

---
_Source: https://npm.io/package/@urbanantics/environme · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
