This module lets you to run node codes in your html!
Example Server.JS
consthtmlNodeCompiler=require("html-node-compiler");constexpress=require("express");constapp=express();app.use(htmlNodeCompiler.callback);app.get("/",(req,res)=>{res.sendNode("index",{myVariable: "Hi!"});// will be rendering index.html});app.listen(3000);
Tags
render{FILE}
Puts file to the html and replaces tags.
Example: render{header}
print{CODE}
Runs code and replaces it with it.
Example: print{2+2} -> 4
Example: print{["2", "3"]} -> ["2", "3"]
Example: print{"<h1>Hi</h1>"} -> # Hi
print_r{CODE}
Runs code and replaces it with it. (Raw result)
Example: print_r{2+2} -> 4
Example: print_r{["2", "3"]} -> 2,3
Example: print_r{"<h1>Hi</h1>"} -> # Hi
print_s{CODE}
Runs code and replaces it with it. (Without html rendering and raw)