2021-08-08 19:11:01 +02:00
2021-08-07 18:44:57 +02:00
2021-08-07 17:21:53 +02:00
2021-04-20 17:25:45 +02:00
2021-08-08 16:40:09 +02:00

JSSTE

npm NPM Downloads

NPM

Desciption

JSSTE is a NodeJS-Module for rendering data in static HTML

Usage

Installation

You can jsste install using npm or yarn.

npm install jsste
yarn add jsste

including in your project

const jsste = require("jsste");

Rendering

jsste.render(pagecode, tempaltecode);

Example

const templatecode = `
<html>
  <head>
    <title>JSSTE Example</title>
  </head>
  <body>
    <h1><[VARNAME1]></h1>
    <p><[VARNAME2]></p>
  </body>
</html>
`;

const pagecode = {"VARNAME1":"Hello World", "VARNAME2":"This is a test"};

let result = Jsste.render(pagecode, templatecode);

// result
// <html>
//   <head>
//     <title>JSSTE Example</title>
//   </head>
//   <body>
//     <h1>Hello World</h1>
//     <p>This is a test</p>
//   </body>
// </html>

Special Variables

  • _TEMPLATE_ -> Defines the path to the temp file
  • _STYLES_ -> Defines a list of CSS files that will be implemented

Example

const templatecode = `
<html>
  <head>
    <title>JSSTE Example</title>
  </head>
  <body>
    <h1><[VARNAME1]></h1>
    <p><[VARNAME2]></p>
  </body>
</html>
`;

const pagecode = {"_STYLES_":["./main","./othercss"] "VARNAME1":"Hello World", "VARNAME2":"This is a test"};

let result = Jsste.render(pagecode, templatecode);

// result
// <html>
//   <head>
//     <title>JSSTE Example</title>
//     <link rel="stylesheet" href="./main">
//     <link rel="stylesheet" href="./othercss">
//   </head>
//   <body>
//     <h1>Hello World</h1>
//     <p>This is a test</p>
//   </body>
// </html>


Description
No description provided
Readme GPL-3.0 404 KiB
Languages
JavaScript 100%