3.0.3 • Published 4 years ago

@axmine/helper v3.0.3

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

@axmine/helper

个人项目辅助方法集

NPM Version GitHub license size-image

安装

npm i @axmine/helper -S

ES6

// ts
import { cookie } from '@axmine/helper/lib/cookie';

// js
import helper from '@axmine/helper';

CommonJS

var helper = require('@axmine/helper');

直接引入

<script src="helper.js"></script>

方法名 或 对象

名称用途说明返回值
cookie.set(    key: string,     value: any,     expireDays: number)存储cookieexpireDays单位为天数boolean
cookie.get(key: string)取出cookie--boolean
cookie.remove(key: string)删除cookie--boolean
new Storage(type:     'localStorage'|'sessionStorage' = 'localStorage')同cookie的方法--同上
random(    min: number = 0,    max: number = 1,     result: 'float'|'int' = 'float')取随机数result为 int 时只返回随机的整数number
getType(data:any)获取参数的类型--string
date.format(    data: number|string,    format: string = 'y-m-d h:i')通过时间戳返回日期通过日期返回时间戳data为数字时,必须为秒数,不支持毫秒data为字符串时,必须为规范的日期字串string | number

更新日志

2021.04.07: 1. 主要语言已转至typescript,用ts把要用的主要方法都重写了

开发说明

// 打包
npm run build

// 测试
npm run test

License

MIT

3.0.3

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago