Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
** This module is under development, but you can try it now because it's ready to use already. **
###Render dynamic data to your template easily. this module is superfast and lightweight, works using simple Js functions.
##Example
html [index.html]
<body>
<%name%> // single % for output
<%% if (user){echo(user.name)}%> // double %% for controlling
<%names[1]%>
<%cat.color%>
<%include("somefile.txt")%>
</body>
now node.js
var madex = require("madex");
var data = fs.readFileSync("./index.html");
var obj={
name:"John",
user:{name:"Smith"},
name:["John", "Doe", "Smith"],
cat : {color:"white", name:"mew"}
}
madex.render(data, obj, function(output){
console.log(output);
});
render() takes three params, first one the data read from file, second one an object containing to be rendered datas and third one a callback function with one param, the returning output.
echo()
is a function introduced to print outputs, which takes one argument.
files get automatically included ( the last line in html page).
##change the delimeter if you dont like it
madex.delim = "$" //or anything else
Sync version of render()
is renderSync()
var output = madex.renderSync(data, obj);
two parameters. first one the data read from file and second one the list to be renderd datas.
FAQs
render dynamic template, fast and easy
The npm package madex receives a total of 0 weekly downloads. As such, madex popularity was classified as not popular.
We found that madex demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.