0.0.28 • Published 2 years ago

common-function-utils v0.0.28

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

补充工具