1.0.0 • Published 2 years ago

itheima-tools-scarlett.jns v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

install

npm install itheima-tools-scarlett.jns

import

const itheima = require('itheima-tools');

format time

const dtStr = itheima.dateFormat(new Date());
console.log(dtStr);
// output: 2020-04-03 17:20:58

escape special charactor of html

const htmlStr = '<h1 title="abc">这是h1标签<span>123&nbsp;</span></h1>';
let str = itheima.htmlEscape(htmlStr);
console.log(str);

unescape special charactor of html

str = itheima.htmlUnescape(str);
console.log(str);

Open Source Protocols

ISC