express-lml
TypeScript icon, indicating that this package has built-in type declarations

0.8.1 • Public • Published

express-lml

Express view engine for LML - an HTML alternative

Install

In your express.js project directory: npm install express-lml --save-dev

Usage

use the exported loader and pass your express app instance: loadViewEngine(app);

You can also pass options for parsing and output (to minify, order attributes etc): loadViewEngine(app, {parse: parseConfig, output: outputConfig}); See LML README for available options.

Example

views/index.lml:

!DOCTYPE html
html
  head
    title ; hello
  body
    h1 ; hello world!

app.js:

const express = require('express');
const expressLML = require('express-lml');
 
const app = express();
const port = 3000;
 
expressLML.loadViewEngine(app);
 
// default folder for your LML files
app.set('views', './views');
 
app.get('/', function (req, res) {
  res.render('index');
});
 
app.listen(port, () => console.log(`Example app listening on port ${port}!`));

Package Sidebar

Install

npm i express-lml

Homepage

lml-dom.org/

Weekly Downloads

1

Version

0.8.1

License

MIT

Unpacked Size

4.58 kB

Total Files

4

Last publish

Collaborators

  • gvarsanyi