@fatesigner/utils
TypeScript icon, indicating that this package has built-in type declarations

2.11.2 • Public • Published

Utils

build commitizen codecov prettier download npm semantic

JavaScript工具库.

说明

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

安装

npm i -S @fatesigner/utils

具体用法可查看 文档

import { toDecimal } from '@fatesigner/utils';

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

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

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

Readme

Keywords

Package Sidebar

Install

npm i @fatesigner/utils

Weekly Downloads

2

Version

2.11.2

License

MIT

Unpacked Size

689 kB

Total Files

61

Last publish

Collaborators

  • fatesigner