common-screw
v1.3.1
Published
提供项目中常用的工具函数,比如时间戳、格式的转换、数据类型判断等。如名字screw一样,做一个项目开发过程中的螺丝钉。
Downloads
58
Readme
English | 简体中文
Front-end business code tool library
Provide the commonly used tool functions in the project, such as timestamp
, conversion of format
, data type judgment
, throttling function
, etc. Like the name screw, be a screw in the project development process.
Purpose: complete front-end business code efficiently
To avoid the trouble of copying and pasting many times for different projects, the common functions in the business development process are encapsulated here and released to npm to improve development efficiency.
Install
npm i common-screw
yarn add common-screw
Demand Loading
Default support for ES Modules-based Tree Shaking
import { randomBoolean, isArray, addDaysToDate } from "common-screw"
randomBoolean() // false
isArray(3) // false
isArray([1, 2]) // true
addDaysToDate("2020-10-15", -10) // 2020-10-05
Module loading
import {
CSBrowser,
CSDate,
CSDown,
CSFormat,
CSFunction,
CSLang,
CSRandom,
CSRegexp
} from "common-screw"
CSDate.addDaysToDate("2021-10-15", -10) // 2021-10-05
CSRandom.randomBoolean() // false