https://github.com/iarkaroy/utils
Common javascript functions
https://github.com/iarkaroy/utils
array function javascript max min number object random string util utils
Last synced: 8 months ago
JSON representation
Common javascript functions
- Host: GitHub
- URL: https://github.com/iarkaroy/utils
- Owner: iarkaroy
- License: mit
- Created: 2018-04-11T16:36:32.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-17T10:08:50.000Z (about 8 years ago)
- Last Synced: 2025-04-24T17:52:18.379Z (about 1 year ago)
- Topics: array, function, javascript, max, min, number, object, random, string, util, utils
- Language: JavaScript
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Javascript Utils
====
A library to provide commonly required javascript functions.
## Installation
```
npm install @iarkaroy/utils
```
## Usage
```
import * as utils from '@iarkaroy/utils';
```
### `is.arr()`
Checks whether the passed argument is an array.
```
utils.is.arr(any);
```
### `is.obj()`
Checks whether the passed argument is an object.
```
utils.is.obj(any);
```
### `is.str()`
Checks whether the passed argument is a string.
```
utils.is.str(any);
```
### `is.fnc()`
Checks whether the passed argument is a function.
```
utils.is.fnc(any);
```
### `is.num()`
Checks whether the passed argument is a number.
```
utils.is.num(any);
```
### `is.und()`
Checks whether the passed argument is undefined.
```
utils.is.und(any);
```
### `is.nul()`
Checks whether the passed argument is null.
```
utils.is.nul(any);
```
### `range(end [, start = 0 [, step = 1]])`
Generates an array with numbers.
```
utils.range(100, 1, 2);
```
### `max()`
Returns max number from an array.
```
utils.max(arrayOfNumbers);
```
### `min()`
Returns min number from an array.
```
utils.min(arrayOfNumbers);
```
### `rand(max [, min = 0])`
Generates random number in specified range.
```
utils.rand(100, 50);
```
## Tests
```
npm test
```
## Author
**Arka Roy**
+ [arkaroy.net](https://www.arkaroy.net/)
+ [github/iarkaroy](https://github.com/iarkaroy)
+ [twitter/iarkaroy](http://twitter.com/iarkaroy)
## License
Copyright © 2018 Arka Roy\
Released under the MIT license.