common-function-utils
TypeScript icon, indicating that this package has built-in type declarations

0.0.28 • Public • Published

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、直接用 <script> 引入,加载后会在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

补充工具

注释

在其他可支持项目中引入该包,并在其项目下执行"npm link common-function-utils",然后正常使用即可。

Package Sidebar

Install

npm i common-function-utils

Weekly Downloads

3

Version

0.0.28

License

MIT

Unpacked Size

77.8 kB

Total Files

24

Last publish

Collaborators

  • robint-liu