1.6.0 • Published 1 year ago

@nuskin/uncle-buck v1.6.0

Weekly downloads
908
License
MIT
Repository
-
Last release
1 year ago

@nuskin/uncle-buck

uncle-buck is a compilation of useful functions.

Installing

Using npm:

npm install @nuskin/uncle-buck

Using yarn:

yarn add @nuskin/uncle-buck

Example Usage

For ESM syntax, use import:

import * as ub from '@nuskin/uncle-buck'

For CommonJS, use require:

const ub = require('@nuskin/uncle-buck')
let obj = { a: 1, b: { c: 0}}
ub.exists(obj,'a') //returns true
ub.exists(obj,'b.c') // returns true

ub.isBoolean(false) // returns true

ub.isJSON('{"abc":true}') // returns true

ub.isNull(null) // returns true

ub.isObject('{"abc":true}') // returns false

ub.isString('my string') // returns true

ub.nvl(null,0)  // returns 0

const myfunc = async () => {
    await sleep(2000) // sleep for 2 seconds
    // do something
}

myfunc()

Resources

License

This project is licensed under the MIT License - see LICENSE for details