Socket
Socket
Sign inDemoInstall

edge.js

Package Overview
Dependencies
29
Maintainers
2
Versions
64
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    edge.js

Template engine


Version published
Weekly downloads
19K
increased by1.89%
Maintainers
2
Created
Weekly downloads
 

Readme

Source

Table of contents

  • Table of contents
  • Maintainers

Edge

A template for Node.js

gh-workflow-image typescript-image npm-image license-image synk-image

Edge is a logical and batteries included template engine for Node.js. It can render any text based format, whether is HTML, Markdown or plain text files.

Usage

Install the package from the npm registry.

npm i edge.js

# yarn
yarn add edge.js

And use it as follows

const { join } = require('path')

// CommonJS
const { Edge } = require('edge.js')

// Typescript import
// import { Edge } from 'edge.js'

const edge = new Edge({ cache: false })
edge.mount(join(__dirname, 'views'))

const html = await edge.render('welcome', {
  greeting: 'Hello world'
})

console.log(html)

Next create the views/welcome.edge file.

<p> {{ greeting }} </p>

Edge was created to be used inside the AdonisJS framework. However it is a framework agnostic library and can be used standalone as well.

The documentation is written on the AdonisJS website. In AdonisJS docs, we refer the edge variable as view.



Keywords

FAQs

Last updated on 14 Aug 2023

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc