<commit_before># node-utils-pkg
Utility package for Node.js
## Installation
```bash
$ npm install utils-pkg --save
```
## Usage
```Javascript
var utils = require("utils-pkg");
```
## Documentation
**.isArray(Value)** => Boolean

Checks if the given value is Array
function calls **Object.prototype**
```Javascript
utils.isArray([1, 2, 3]); // Returns true
utils.isArray(true);      // Returns false
```

* * *

**.isNumber(Value)** => Boolean

Checks if the given value is Number type

function calls **Object.prototype**
```Javascript
utils.isNumber(1);        // Returns true
utils.isNumber(1.2);      // Returns true
utils.isNumber("2");      // Returns false
```

* * *

**.isJSON(Value)** => Boolean

Check if the given value is a valid JSON

Function tries to parse the value, in case the parsing failes the function will return false
```Javascript
var jsonString = '{"name":"nost","email":"<EMAIL>"}';

utils.isJSON(jsonString);  // Returns true
utils.isJSON({});          // Returns false
```

* * *

**.isObject(Value)** => Boolean

Checks if the given value is Object

function calls **Object.prototype**
```Javascript
utils.isObject({});       // Returns true
utils.isObject([]);       // Returns false
```

* * *

**.isString(Value)** => Boolean

Checks if the given value is String

function calls **Object.prototype**
```Javascript
utils.isString("Hello world");  //Returns true
utils.isString(2);              //Returns false
```

* * *

**.isBoolean(Value)** => Boolean

Checks if the given value is Boolean

function calls **Object.prototype**
```Javascript
utils.isBoolean("true");         //Returns false
utils.isBoolean(true);           //Returns true
utils.isBoolean(false);          //Returns true
```

**.inArray(Array, [String | Array])** => Boolean

Checks if a value is inside an Array
in case if the value to look is also an array, the function will return true if all elements from the value are found
```Javascript
var arr = ["a", "b", "c", "d"];

utils.inArray(arr, "a");         // Returns true
utils.inArray(arr, 2);           // Returns false
utils.inArray(arr, ["a", "c"]);  // Returns true
utils.inArray(arr, ["a", "e"]);  // Returns false
```

* * *

**.inKeyObject(Object, [String | Array])** => Boolean

Check if the given object has the property name as the given String

if the second parameter is an Array, it will turn all propertys into array and call **inArray()**
```Javascript
var obj = {
	name: "nost",
	email: "<EMAIL>"
};

utils.inKeyObject(obj, "name");             //Returns true
utils.inKeyObject(obj, ["name", "email"]);  //Returns true<commit_msg>+ build status, isFunction md docs<commit_after># node-utils-pkg
[![Build Status](https://travis-ci.org/Nosthertus/node-utils-pkg.svg?branch=master)](https://travis-ci.org/Nosthertus/node-utils-pkg)

Utility package for Node.js

## Installation
```bash
$ npm install utils-pkg --save
```
## Usage
```Javascript
var utils = require("utils-pkg");
```
## Documentation
**.isArray(Value)** => Boolean

Checks if the given value is Array
function calls **Object.prototype**
```Javascript
utils.isArray([1, 2, 3]); // Returns true
utils.isArray(true);      // Returns false
```

* * *

**.isNumber(Value)** => Boolean

Checks if the given value is Number type

function calls **Object.prototype**
```Javascript
utils.isNumber(1);        // Returns true
utils.isNumber(1.2);      // Returns true
utils.isNumber("2");      // Returns false
```

* * *

**.isJSON(Value)** => Boolean

Check if the given value is a valid JSON

Function tries to parse the value, in case the parsing failes the function will return false
```Javascript
var jsonString = '{"name":"nost","email":"<EMAIL>"}';

utils.isJSON(jsonString);  // Returns true
utils.isJSON({});          // Returns false
```

* * *

**.isObject(Value)** => Boolean

Checks if the given value is Object

function calls **Object.prototype**
```Javascript
utils.isObject({});       // Returns true
utils.isObject([]);       // Returns false
```

* * *

**.isString(Value)** => Boolean

Checks if the given value is String

function calls **Object.prototype**
```Javascript
utils.isString("Hello world");  //Returns true
utils.isString(2);              //Returns false
```

* * *

**.isBoolean(Value)** => Boolean

Checks if the given value is Boolean

function calls **Object.prototype**
```Javascript
utils.isBoolean("true");         //Returns false
utils.isBoolean(true);           //Returns true
utils.isBoolean(false);          //Returns true
```

* * *

**.isFunction(Value)** => Boolean

Checks if the given value is function

```Javascript
var func = function(){};

utils.isFunction(true);         //Returns false
utils.isFunction(func);         //Returns true
utils.isFunction(function(){}); //Returns true
utils.isFunction("function");   //Returns false
```

* * *

**.inArray(Array, [String | Array])** => Boolean

Checks if a value is inside an Array
in case if the value to look is also an array, the function will return true if all elements from the value are found
```Javascript
var arr = ["a", "b", "c", "d"];

utils.inArray(arr, "a");         // Returns true
utils.inArray(arr, 2);           // Returns false
utils.inArray(arr, ["a", "c"]);  // Returns true
utils.inArray(arr, ["a", "e"]);  // Returns false
```

* * *

**.inKeyObject(Object, [String | Array])** => Boolean

Check if the given object has the property name as the given String

if the second parameter is an Array, it will turn all propertys into array and call **inArray()**
```Javascript
var obj = {
	name: "nost",
	email: "<EMAIL>"
};

utils.inKeyObject(obj, "name");             //Returns true
utils.inKeyObject(obj, ["name", "email"]);  //Returns true
{'fraction_non_alphanumeric': 0.16631467793030624, 'fraction_numerical': 0.0031678986272439284, 'mean_word_length': 3.658196721311475, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 24, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5744231', 'n_tokens_mistral': 1764, 'n_tokens_neox': 1700, 'n_words': 573}