dodo-js-lib

1.0.22 • Public • Published

js 常用工具函数集合

工作中使用到的 js 函数!

介绍

  1. 格式化时间:formatDatetime(time='', str='datetime')

安装

 npm i dodo-js-lib --save

使用

import * as jslib from 'dodo-js-lib' 
console.log(jslib.formatDatetime(), formatDatetime())

更新记录

1.0.1 - 2020-01-01

formatDatetime 函数

alert(lib.formatDatetime('Fri Nov 25 2022 14:54:58 GMT+0800 (中国标准时间)'))  // new Date().toString()
alert(lib.formatDatetime('2022-11-25 12:12:12'))  // format
alert(lib.formatDatetime('2022-11-25T06:52:17.041Z'))  // new Date().toJSON()
alert(lib.formatDatetime(1669359195535))  // new Date().getTime()

rewirteLog 函数

重写console方法,在生产环境中不显示调试log
在main.js中
import {rewirteLog} from './lib/utils'
rewirteLog()

1.0.18 - 2023-01-01

Readme

Keywords

Package Sidebar

Install

npm i dodo-js-lib

Weekly Downloads

1

Version

1.0.22

License

ISC

Unpacked Size

39.1 kB

Total Files

17

Last publish

Collaborators

  • dodo6655