@2dan/utils
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

@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)

Dependencies (9)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @2dan/utils

    Weekly Downloads

    16

    Version

    1.3.0

    License

    ISC

    Unpacked Size

    59.7 kB

    Total Files

    20

    Last publish

    Collaborators

    • 2dan