2.0.0 • Published 6 days ago

express-boxwood v2.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 days ago

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

@emilos.

Contributing

All contributions are highly appreciated! Open an issue or a submit PR.

License

MIT © buxlabs