3.0.1 • Published 1 year ago

neobiz-express v3.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

read example.js file

import express from "express";
import neoex from "neobiz-express";

const app = new express();
neoex(app, "./view"); //@params expressApp, path2view

app.get("/", (req, res) => {
  // no need to write .js, actually don't
  res.render("landing.v", { title: "data" });
});
res.render(
  // views
  ({ username }) => ({
    h1: { text: "Hello world! " + username },
  }),
  // passing value
  {
    template: "t.v", //use template
    title: "on the go",
    username: "dim24",
  }
);

templates

res.render("landing.v", { title: "data", template: "main.v" });

main.js

module.exports = (contents, { title }) => ({
  head: { title: { text: title } },
  body: contents, //child
});
3.0.1

1 year ago

1.2.6

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago