Coder Social home page Coder Social logo

nully0x / edge Goto Github PK

View Code? Open in Web Editor NEW

This project forked from edge-js/edge

0.0 0.0 0.0 7 MB

Node.js templating engine with fresh air

Home Page: https://docs.adonisjs.com/guides/views/introduction

License: MIT License

JavaScript 16.38% TypeScript 83.57% Shell 0.06%

edge's Introduction

Table of contents

Edge

A template for Node.js

gh-workflow-image appveyor-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.

edge's People

Contributors

thetutlage avatar dependabot[bot] avatar omgimalexis avatar gavinhenderson avatar romainlanz avatar snyk-bot avatar temasm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.