1.0.0 • Published 2 years ago

jsembedtemplateengine v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

JSembedTemplateEngine

NPM

I couldn't think of a name that's more stupid.

I am recreating EJS??? This time, it's an Express.JS engine.

Exampel:

const engine = require("jsembedtemplateengine");
const app = require("express")();
engine(app);
app.set('views', '.')
app.set('view engine', 'jsembeds');

app.get("/", function(req, res) {
	res.render("index", { value: "content" });
});

Customisation

The first argument to the engine function is ALWAYS the express app object.

The second argument is JSEmbeds' options, but in an object.

Example with embedOpen and embedClose:

engine(app, {embedOpen: "<embed>", embedClose: "</embed>" });