dependabot[bot] 3552a43714
Bump nanoid and mocha
Bumps [nanoid](https://github.com/ai/nanoid) to 3.3.3 and updates ancestor dependency [mocha](https://github.com/mochajs/mocha). These dependencies need to be updated together.


Updates `nanoid` from 3.1.20 to 3.3.3
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.20...3.3.3)

Updates `mocha` from 8.4.0 to 10.1.0
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v8.4.0...v10.1.0)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
- dependency-name: mocha
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-03 18:43:20 +00:00
2021-08-08 19:17:12 +02:00
2022-11-03 19:27:13 +01:00
2022-11-03 19:27:13 +01:00
2022-10-27 19:19:23 +02:00
2021-04-20 17:25:45 +02:00
2022-11-03 18:43:20 +00:00
2022-11-03 18:43:20 +00:00
2022-10-31 18:05:31 +01:00
2022-11-03 18:43:20 +00: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

Include States

You can include an Callbackfunction that will be called when the state is change

jsste.setStateFunction(({ status, statusMSG }) => {
  yourstatus = status;
  yourstatusMSG = statusMSG;
});

States-Codes

Code Meaning
0 OK
1 ERROR
2 WARNING
3 INFO
4 DEBUG

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.css">
//     <link rel="stylesheet" href="./othercss.css">
//   </head>
//   <body>
//     <h1>Hello World</h1>
//     <p>This is a test</p>
//   </body>
// </html>

Examples on https://github.com/lucaspalomodevelop/JSSTE-Examples

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