@2dan/utils
z_fay@163.com
install
npm install @2dan/utils
logger
const {logger} = require('@2dan/utils');
logger.info('test');
logger.warn('test');
logger.error('test');
time
const {time} = require('@2dan/utils');
time.getunixTime();
time.getdateTime();
time.getTime0h0m0s_unix();
utils
const {util} = require('@2dan/utils');
util.uuid();
util.getLocalIP();
util.randomString();
crypto
const {crypto} = require('@2dan/utils');
crypto.md5('123');
crypto.sha1('123');
crypto.getRandomSalt();
events
const {events} = require('@2dan/utils');
let id = events.loop_create(10,()=>{
console.log('loop 10s')
});
events.loop_kill(id)
events.task_create(23,59,()=>{
console.log('23:59:00')
})
events.sleep(()=>{
console.log('sleep 10s')
},10)
@2dan/utils
z_fay@163.com
install
npm install @2dan/utils
logger
const {logger} = require('@2dan/utils');
logger.info('test');
logger.warn('test');
logger.error('test');
time
const {time} = require('@2dan/utils');
time.getunixTime();
time.getdateTime();
time.getTime0h0m0s_unix();
utils
const {util} = require('@2dan/utils');
util.uuid();
util.getLocalIP();
util.randomString();
crypto
const {crypto} = require('@2dan/utils');
crypto.md5('123');
crypto.sha1('123');
crypto.getRandomSalt();
events
const {events} = require('@2dan/utils');
let id = events.loop_create(10,()=>{
console.log('loop 10s')
});
events.loop_kill(id)
events.task_create(23,59,()=>{
console.log('23:59:00')
})
events.sleep(()=>{
console.log('sleep 10s')
},10)