Git Product home page Git Product logo

util-helpers's Introduction

util-helpers

GitHub Build Status

util-helpers 是一个基于业务场景的工具方法库。

使用

npmyarn 安装

npm install util-helpers --save
yarn add util-helpers

浏览器引入

在浏览器中使用 script 标签直接引入文件,并使用全局变量 utilHelpers

npm 包的 util-helpers/dist 目录下提供了 util-helpers.js 以及 util-helpers.min.js。你也可以通过 UNPKG 进行下载。

强烈不推荐使用已构建文件,这样无法按需加载。

示例

import { isMobile, formatMoney } from 'util-helpers'

isMobile("13000000000") // => true
formatMoney('1000') // => 1,000.00

按需引入

如果你使用 babel,推荐使用 babel-plugin-import ,在 babelplugin 中添加以下配置

['import', { 
  libraryName: 'util-helpers', 
  camel2DashComponentName: false,
  customName: require('path').join(__dirname, './node_modules/util-helpers/module-config.js')
}, 'util-helpers']

然后跟上面示例一样写法

文档

精选第三方工具库

  • lodash - 封装了诸多对字符串、数组、对象等常见数据类型的处理函数
  • query-string - URL解析、序列化
  • qs - URL查询字符串解析和序列化库
  • js-cookie - 一个简单,轻量级的JavaScript API,用于处理cookie
  • number-precision - 使用javascript精确地执行加法,减法,乘法和除法运算
  • moment - 一个轻量级JavaScript日期库,用于解析,验证,操作和格式化日期。
  • dayjs - 使用相同的现代API 快速2kB替代Moment.js
  • axios - 基于Promise的HTTP客户端,用于浏览器和node.js
  • jsencrypt - 用于执行OpenSSL RSA加密,解密和密钥生成的Javascript库。
  • crypto-js - 加密标准的JavaScript库。(AES/SHA256/MD5/SHA1...但没有RSA)

util-helpers's People

Contributors

caijf avatar roxyhuang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.