1.0.1 • Published 4 years ago

@forgleaner/utils v1.0.1

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

Utils

build commitizen codecov download npm semantic

JavaScript工具库.

说明

  • 此工具库是自己从事前端开发以来整理和完善的,里面有些函数可以用 Underscorelodash 代替。
  • 由 typescript 编写,并编译为一份 ESnext 和 CommonJs 的代码。 所以如果引入到您的项目中使用,需搭建好 babel 编译环境。
  • 借助于 tree shaking 可以不用担心导入多余的代码。

安装

npm i -S @forgleaner/utils

具体用法可查看 文档

import { ToDecimal } from '@forgleaner/utils';

let num = 120;
console.log(ToDecimal(num, 2));
// 120.00

// 绑定事件:delegate
import { On } from '@forgleaner/utils/event';

On(document.body, 'scroll', null, (event) => {
  console.log(event.target);
});