wodebaobao

提供了时间格式化,HTMLEscape相关的功能

Usage no npm install needed!

<script type="module">
  import wodebaobao from 'https://cdn.skypack.dev/wodebaobao';
</script>

README

安装

npm install wode-bo

导入

const buling = require('./wode-bao') 

格式时间

时间格式化 缩写sjgsh   方法名 sjgsh() 

const ds = buling.sjgsh(new Date())

//补零 缩写bl 方法名 bl()
const dd = buling.bl();

HTML转换字符

//HTML转换字符 方法名 htmlzhuan()

const dds = '<h1>123</h1>'
const fafa = buling.htmlzhuan(dds);
console.log(fafa);
转换结果 &lt;h1&gt;123&lt;/h1&gt;

还原HTML转换字符

//字符转换HTML 方法名 zhuanhtml()
const htll = buling.zhuanhtml(fafa);
console.log(htll);
结果 <h1>123</h1>

下载nrm工具

安装成全局工具
npm i nrm -g

如果nrm无法使用

如果显示如下报错:
nrm : 无法加载文件 C:\Users\HP\AppData\Roaming\npm\nrm.ps1,因为在此系统上禁止运行脚本。
则需要执行如下代码:
1.以管理员身份运行powershell

2.使用set-ExecutionPolicy RemoteSigned命令将计算机上的执行策略更改为 RemoteSigned,输入Y确定

3.查看计算机执行策略get-ExecutionPolicy

通过终端登陆npm

npm longin 发起登陆

会显示如下代码:
Username: 用户名
Password: 密码//注意密码输入的看不见需要盲打
Email: (this IS public) 邮箱

发布包

cd切换到包的根目录
PS G:\上课素材\xuexiziyiao\xuexi\jichuban\nodeJS\3node> cd wode-bao
切换后
PS G:\上课素材\xuexiziyiao\xuexi\jichuban\nodeJS\3node\wode-bao> 
发布包
npm publish 








##查看下包地址

nrm ls

npm config get registry

##nrm use 地址名 切换下包地址

nrm use 地址名 切换下包地址 npm config get registry=htttp://registry.npm.taobao.org