@2dan/utils
v1.3.0
Published
##### [email protected]
Downloads
44
Readme
@2dan/utils
[email protected]
###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)