npm install MyDemo_xxy
const myDemo = require('MyDemo_xxy')
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,function(match){
switch(match){
case '<':
return '<';
case '>':
return '>';
case '&':
return '&';
case '"':
return '"';
}
})
}
function htmlUnEscape(str){
return str.replace(/<|>|&|"/g,function(match){
switch(match){
case '<':
return '<';
case '>':
return '>';
case '&':
return '&';
case '"':
return '"';
}
})
}
ISC