https://github.com/jamen/pixie-cli
Create and compile templates from the command line
https://github.com/jamen/pixie-cli
Last synced: about 1 year ago
JSON representation
Create and compile templates from the command line
- Host: GitHub
- URL: https://github.com/jamen/pixie-cli
- Owner: jamen
- License: mit
- Created: 2016-09-19T08:11:22.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-09T22:00:55.000Z (almost 9 years ago)
- Last Synced: 2025-03-09T07:23:05.470Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pixie-cli [](https://npmjs.org/package/pixie-cli)
> Create and compile templates from the command line.
```sh
# Rendering:
echo "Foo {{bar}} baz" | pixie --bar='BLAG'
# Foo BLAG baz
# Parsing:
echo "Hello {{world}}?" | pixie parse
# [["Hello ","?\n"],["world"]]
# Compiling (template above):
echo '[["Hello ","?\\n"],["world"]]' | pixie compile --world='Earth'
# Hello Earth?
```
CLI wrapper over [`pixie`](https://github.com/jamen/pixie), to easily create and compile templates from command line. You can also use a `.pixierc` file, or any [other methods the `rc` module supports](https://github.com/dominictarr/rc#standards)
## Installation
```sh
$ npm install --global pixie-cli
```
## API
### `pixie render`
Render the STDIN against the supplied data. Running `pixie` aliases to this.
```sh
echo "Foo {{bar}} baz" | pixie --bar='12345'
# Foo 12345 baz
```
### `pixie parse`
Parse the STDIN into a Pixie template.
```sh
echo "Foo {{bar}} baz" | pixie parse
# [["Foo "," baz\n"],["bar"]]
```
### `pixie compile`
Compile the STDIN as a template, against data supplied through options or config.
```sh
cat template.json | pixie compile --bar='12345'
# Foo 12345 baz
```
## License
MIT © [Jamen Marz](https://github.com/jamen)