npm package: @nuskin/npm-library-template
Description: uncle-buck` is a compilation of useful functions.
Author: Ian Harisay
Latest version: 1.0.0

# @nuskin/uncle-buck

`uncle-buck` is a compilation of useful functions.

## Installing

Using npm:

```bash
npm install @nuskin/uncle-buck
```

Using yarn:

```bash
yarn add @nuskin/uncle-buck
```

## Example Usage

```js
const ub = require('@nuskin/uncle-buck')

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
```

## Functions

<dl>
<dt><a href="#isJSON">isJSON(str)</a> ⇒ <code>Boolean</code></dt>
<dd><p>isJSON tests if <code>str</code> is valid JSON.</p>
</dd>
<dt><a href="#isNull">isNull(n)</a> ⇒ <code>Boolean</code></dt>
<dd><p>isNull tests if <code>n</code> is <code>null</code> or <code>undefined</code>.</p>
</dd>
<dt><a href="#isObject">isObject(variable)</a> ⇒ <code>Boolean</code></dt>
<dd><p>isObject tests if <code>variable</code> is an object</p>
</dd>
<dt><a href="#isString">isString(variable)</a> ⇒ <code>Boolean</code></dt>
<dd><p>isString tests if <code>variable</code> is a String</p>
</dd>
<dt><a href="#nvl">nvl(n, (*))</a> ⇒ <code>*</code></dt>
<dd><p>nvl lets you replace null or undefined with a value of your choice. If <code>n</code> is null or undefined,
then nvl returns <code>val</code>. If <code>n</code> is not null or undefined, then nvl returns <code>n</code>.</p>
</dd>
</dl>

<a name="isJSON"></a>

## isJSON(str) ⇒ <code>Boolean</code>
isJSON tests if `str` is valid JSON.

**Kind**: global function  
**Returns**: <code>Boolean</code> - Returns true if string is valid JSON  

| Param | Type | Description |
| --- | --- | --- |
| str | <code>String</code> | String to test |

<a name="isNull"></a>

## isNull(n) ⇒ <code>Boolean</code>
isNull tests if `n` is `null` or `undefined`.

**Kind**: global function  
**Returns**: <code>Boolean</code> - Returns true if the value is `null` or `undefined`  

| Param | Type | Description |
| --- | --- | --- |
| n | <code>\*</code> | value to test |

<a name="isObject"></a>

## isObject(variable) ⇒ <code>Boolean</code>
isObject tests if `variable` is an object

**Kind**: global function  
**Returns**: <code>Boolean</code> - Returns true if `variable` is an object  

| Param | Type | Description |
| --- | --- | --- |
| variable | <code>\*</code> | value to test |

<a name="isString"></a>

## isString(variable) ⇒ <code>Boolean</code>
isString tests if `variable` is a String

**Kind**: global function  
**Returns**: <code>Boolean</code> - Returns true if `variable` is a String  

| Param | Type | Description |
| --- | --- | --- |
| variable | <code>\*</code> | value to test |

<a name="nvl"></a>

## nvl(n, (*)) ⇒ <code>\*</code>
nvl lets you replace null or undefined with a value of your choice. If `n` is null or undefined,
then nvl returns `val`. If `n` is not null or undefined, then nvl returns `n`.

**Kind**: global function  
**Returns**: <code>\*</code> - Returns `val` when `n` is null or undefined  

| Param | Type | Description |
| --- | --- | --- |
| n | <code>\*</code> | The value you want to test for null or undefined |
| (*) |  | val - The value you want returned when `n` is null or undefined |


## Resources

- Changelog could go here

## License

[MIT](https://opensource.org/licenses/MIT)