🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

edgejs-cli

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

edgejs-cli

CLI utility to generate files based on edge templates

1.0.0
npm
Version published
Maintainers
0
Created
Source

edgejs-cli

:warning: Maturity Level: Alpha

Minimal CLI utility to generate files using edge.js templates

Usage

pnpm i -g edgejs-cli # Will add an edget utility to PATH

# Render a single template
edget -i templates/home.edge -o site/home.html 

# Pass data to templates through a JSON/YAML file
edget -i templates/home.edge -o site/home.html -c context.json

# Render all templates in a directory (Files prefixed with . or _ are ignored)
edget -i templates -o site -c context.json

# Skip escaping if generating non-html content
edget -i sql-templates -o sql --skipEscaping

Use cases

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

Motivations

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.

Keywords

edge.js

FAQs

Package last updated on 15 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts