# auth0-json-templating

> Constructs Auth0 tenant template details, replacing with env values.

Latest version **1.0.5** (published 2018-12-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install auth0-json-templating
pnpm add auth0-json-templating
yarn add auth0-json-templating
bun add auth0-json-templating
```

Provides the command `auth0-json-templating`.

## 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.5 |
| Published | 2018-12-25 |
| First published | 2018-12-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 10.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Loudbinary |
| Maintainers | loudbinary |

## Links

- npm: https://www.npmjs.com/package/auth0-json-templating
- Repository: https://github.com/loudbinary/auth0-json-templating
- Homepage: https://github.com/loudbinary/auth0-json-templating#readme
- Issues: https://github.com/loudbinary/auth0-json-templating/issues
- npm.io page: https://npm.io/package/auth0-json-templating

## Dependencies (6)

- [dotenv](https://npm.io/package/dotenv.md) ^6.2.0
- [envkey](https://npm.io/package/envkey.md) ^1.2.4
- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [fs-extra](https://npm.io/package/fs-extra.md) ^7.0.1
- [commander](https://npm.io/package/commander.md) ^2.19.0
- [directory-tree](https://npm.io/package/directory-tree.md) ^2.2.0

## Recent versions

- 1.0.5 (latest) — 2018-12-25
- 1.0.4 — 2018-12-25
- 1.0.3 — 2018-12-22
- 1.0.2 — 2018-12-22
- 1.0.1 — 2018-12-22
- 1.0.0 — 2018-12-22

## README

# auth0-json-templating

Purpose: Replace strings and arrays within JSON files exports by Auth0 Cli.

I'd found array replacement was haphazzard, and caused issues during native replacement.

Recursively, for each json file found in templateDirectory
 - Replace all values, matching ##ENVIRONMENT_VARIABLE## as string in file
 - Replace all values, matching @@ENVIRONMENT_VARIABLE@@ as array for parent object
   - Performing CSV split, and appending each item appropriately.
- If an expected replacement is found, and no matching Environment Variable, processing fails.
- Store json in saveDirectory
- Copy remaining .js and .html files into saveDirectory

For variable replacement of .js and .html, use native Auth0 Cli replacement.  I found this to work well.

Usage:
node app.js --templateDirectory <path to folder> --saveDirectory <save path> --envFile <path to envfile>

You may omit --envFile, by executing as
ENVKEY=<envkey> --templateDirectory <path to folder> --saveDirectory <save path> --envFile <path to envfile>

or, simply having ENVKEY exported into current shell, prior to executing node.

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