@nuskin/uncle-buck

uncle-buck is a compilation of useful functions.

Usage no npm install needed!

<script type="module">
  import nuskinUncleBuck from 'https://cdn.skypack.dev/@nuskin/uncle-buck';
</script>

README

@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

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