https://github.com/saghul/njk
Powerful portable templating in less than 1MB
https://github.com/saghul/njk
Last synced: over 1 year ago
JSON representation
Powerful portable templating in less than 1MB
- Host: GitHub
- URL: https://github.com/saghul/njk
- Owner: saghul
- License: mit
- Created: 2021-06-14T07:23:47.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-06-30T08:13:41.000Z (about 3 years ago)
- Last Synced: 2025-02-28T12:06:37.880Z (over 1 year ago)
- Language: C
- Homepage:
- Size: 538 KB
- Stars: 21
- Watchers: 5
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# njk: powerful portable templating
*njk* is a single binary command line application designed to provide powerful
templating capabilities using environment variables.
Its primary use is to build configuration files at boot time in containerized
environments.
*njk* stands on shoulders of giants. It uses [Nunjucks](https://mozilla.github.io/nunjucks/)
as the templating engine and [QuickJS](https://bellard.org/quickjs/) as the
runtime. The result is **a statically linked binary which is < 1MB**.
**NOTE:** Windows is not currently supported.
## Usage
```bash
./njk /path/to/template-file.njk > /config/your-config-file
```
Example:
```
Hello, {{ env.USER }}
```
## Documentation
Check the [Nunjucks documentation on templating](https://mozilla.github.io/nunjucks/templating.html).
**NOTE:** Templates get a single context variable: `env` containing the environment
variables.
## Similar tools
* [frep](https://github.com/subchen/frep)