CLI utility to generate files based on edge templates
npm install edgejs-cliMinimal CLI utility to generate files using edge.js templates
``sh
pnpm i -g edgejs-cli^ Will add an edget utility to PATH
Advanced features
$3
It is not necessary that each input file generate exactly one input file, or that the output file name match input file name.
With multi-mode, we can render an output in the following format (inspired by Vue SFC):
`xml
Here is some summary content
Here are some details
`Note that the file extension needs to be
.multi.edge.This will generate two files
with content Here is some summary content and with content Here are some details.XML parsing happens after the edge template has been rendered,
so not only can the content inside
tags be dynamic, we can also dynamically add tags too.So the following is legal:
`xml
@each (post in posts)
{{post.title}} - by {{post.author}}
{{post.body}}
@end
`(final output must be valid XML)
It is possible to dedent and trim the content through attributes in the file tag:
`xml
``This is intended to be a minimal utility that simplifies tasks like below for JS/TS developers comfortable with CLI:
- Building static sites
- Knowledge-graphs
- Code generation
- Using edge.js from other languages
If you don't care about cross-language support, edgejs is easier than Handlebars/mustache/liquid etc.
because the embedded expressions are plain JS - so there is less need to learn custom syntax specific
to the templating language, and we also have first class support for async.
Also, unlike JSX based solutions, it is more versatile because it is not limited to HTML
---
:warning: This project has nothing to do with Microsoft edge browser.