0.0.28 • Published 3 years ago
common-function-utils v0.0.28
common-function-utils
在业务开发中常用的前端工具函数。
安装及用法
1、NPM
npm install common-function-utils -S
yarn add common-function-utils -S
// ES module:
import { setCookieItem, getCookieItem } from "common-function-utils"
setCookieItem("test1", "Unicode test: \u6bd4\u8bfa");
getCookieItem('test1'); // Unicode test: 比诺
// CommonJs:
var commonUtils = require("common-function-utils");
commonUtils.languageInfo(); // { "language": "zh-cn", "languages": ["zh-CN" ] }
2、直接用 \ 引入,加载后会在window上会挂载 commonUtils,具体URL请查看 cdn files
<script src="file url"></script>
<script>
const clientName = commonUtils.clientName();
console.log(clientName); // SM-G900P
</script>
文档
调试及构建
# 自动生成API文档和脚本
npm start
# 测试
npm run test
# 代码检查
npm run fix
# 打包
npm run build
项目发布
☞ npm login
☞ npm publish
补充工具
- https://github.com/lodash/lodash
- https://github.com/iamkun/dayjs
- https://github.com/jashkenas/underscore
- https://github.com/jashkenas/backbone/
- https://github.com/shadowOfCode/bee.js
- https://github.com/tnfe/bbo
- https://github.com/proYang/outils
- https://github.com/liriliri/licia
- https://www.jb51.net/article/195385.htm
- https://www.cnblogs.com/aidixie/p/11401382.html
- https://www.sohu.com/a/397823902_744986
- ······