Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ecrmnn/express-edge
🔤  Use Edge templating engine with Express
https://github.com/ecrmnn/express-edge
edge express expressjs template template-engine templating
Last synced: about 1 month ago
JSON representation
🔤  Use Edge templating engine with Express
- Host: GitHub
- URL: https://github.com/ecrmnn/express-edge
- Owner: ecrmnn
- License: mit
- Created: 2018-02-22T07:43:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-14T21:35:55.000Z (over 1 year ago)
- Last Synced: 2024-09-29T12:40:55.792Z (about 2 months ago)
- Topics: edge, express, expressjs, template, template-engine, templating
- Language: JavaScript
- Homepage: https://npmjs.com/express-edge
- Size: 14.6 KB
- Stars: 52
- Watchers: 2
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# express-edge
> Use Edge templating engine with Express
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fecrmnn%2Fexpress-edge%2Fbadge%3Fref%3Dmaster&style=flat-square&label=build)](https://github.com/ecrmnn/express-edge/actions)
[![npm version](https://img.shields.io/badge/Node.js-v14%2B-green?style=flat-square)](https://github.com/ecrmnn/express-edge)
[![npm version](https://img.shields.io/npm/v/express-edge.svg?style=flat-square)](http://badge.fury.io/js/express-edge)
[![npm downloads](https://img.shields.io/npm/dm/express-edge.svg?style=flat-square)](http://badge.fury.io/js/express-edge)
[![npm license](https://img.shields.io/npm/l/express-edge.svg?style=flat-square)](http://badge.fury.io/js/express-edge)
[![prs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
[![eslint](https://img.shields.io/badge/code_style-airbnb-blue.svg?style=flat-square)](https://github.com/airbnb/javascript)## Installation
```bash
npm install express-edge --save
```## Usage
See the [Edge documentation](https://docs.adonisjs.com/guides/views/introduction) for how to structure your templates.
Requires Node.js 14+ from `express-edge@3`
```javascript
const express = require('express');
const app = express();
const engine = require('express-edge');// Automatically sets view engine and adds dot notation to app.render
app.use(engine);
app.set('views', `${__dirname}/views`);// Configure view caching
app.enable('view cache');
// --- or ---
app.diable('view cache');app.get('/', (req, res) => {
res.render('users.index', { users });
});app.listen(3000);
```## License
MIT © [Daniel Eckermann](http://danieleckermann.com)