express-boxwood
v2.0.0
Published
express boxwood
Downloads
8
Readme
express-boxwood
boxwood in express.
Table of Contents
Background
The library makes it easier to use boxwood as a view engine in express. It handles file loading, caching and purging the cache in the development environment.
Install
npm install boxwood express-boxwood
Usage
const path = require("path")
const express = require("express")
const { compile } = require("boxwood")
const engine = require("express-boxwood")
const app = require("app")
app.engine("js", engine({ compile }))
app.set("views", path.join(__dirname, "views"))
app.set("view engine", "js")
// other app code
API
compile
You need to explicitly pass the compile method.
env = process.env.NODE_ENV || 'development'
You can explicitly set the env in which express-boxwood
is running. It defaults to the development mode, which does not cache the compiled template. Please ensure your NODE_ENV
is set for your production environment to enable caching.
Maintainers
Contributing
All contributions are highly appreciated! Open an issue or a submit PR.
License
MIT © buxlabs