npm install MyDemo_kdl
const myDemo=require('MyDemo')
function formatDate() {
var date = new Date();
var year = date.getFullYear();
var month = date.getMonth() + 1;
var day = date.getDate();
var hour = date.getHours();
var minute = date.getMinutes();
var second = date.getSeconds();
return year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + second;
}
function htmlEscape(htmlStr){
return htmlStr.replace(/<|>|"|&/g,(match)=>{
switch(match){
case "<":
return "<";
case ">":
return ">";
case "&":
return "&";
case '"':
return """;
}
})
}
function htmlUnEscape(Str){
return Str.replace(/<|>|"|&/g,(match)=>{
switch(match){
case "<":
return "<";
case ">":
return ">";
case """:
return '"';
case "&":
return "&";
}
})
ISC