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

1.0.7 • Public • Published

前端常用工具函数

汇总常用工具函数


简介

前端项目开发中,经常使用一些工具函数,随着项目数量的增多,工具函数的增多,在每个项目里面都维护一个 util.js 会带来不少的麻烦,所以统一为一个工具函数包

安装使用

1. 安装包使用方式

安装

# npm
npm install wlxl-utils -S

# yarn
yarn add wlxl-utils -S

ESM 导入使用

import { random } from 'wlxl-utils'
console.log(random(1, 10))

RequireJS 导入使用

const { random } = require('wlxl-utils')
console.log(random(1, 10))

2. 网页 script 直接引入使用方式

直接拷贝 dist 下的 wlxl-utils-umd.js 到项目里面,可直接引用

<!DOCTYPE html>
<html lang="en">
	<body>
		<script src="/dist/wlxl-utils-umd.js"></script>
		<script>
			console.log(dutils.random(1, 10))
		</script>
	</body>
</html>

Package Sidebar

Install

npm i wlxl-utils

Weekly Downloads

1

Version

1.0.7

License

none

Unpacked Size

54.6 kB

Total Files

5

Last publish

Collaborators

  • youhuabujianye