# mid-utils

> For Member ID Projects

Latest version **1.0.2** (published 2022-01-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install mid-utils
pnpm add mid-utils
yarn add mid-utils
bun add mid-utils
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-01-13 |
| First published | 2022-01-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | syaiful-mid |

## Links

- npm: https://www.npmjs.com/package/mid-utils
- npm.io page: https://npm.io/package/mid-utils

## Recent versions

- 1.0.2 (latest) — 2022-01-13
- 1.0.1 — 2022-01-13
- 1.0.0 — 2022-01-13

## README

# MID Utilities
For Member ID Projects

![](https://img.shields.io/static/v1?label=npm&message=7.10.0&style=plastic&logo=npm&color=green)
![](https://img.shields.io/static/v1?label=node&message=v15.14.0&style=plastic&logo=Node.js&color=green)
![](https://img.shields.io/static/v1?label=&message=typescript&style=plastic&logo=ts-node&color=grey)


---
## Requirements

For development, you will only need Node.js and a node global package, Yarn, installed in your environment.

### Node
- #### Node installation on Windows

  Just go on [official Node.js website](https://nodejs.org/) and download the installer.
Also, be sure to have `git` available in your PATH, `npm` might need it (You can find git [here](https://git-scm.com/)).

- #### Node installation on Ubuntu

  You can install nodejs and npm easily with apt install, just run the following commands.

      $ sudo apt install nodejs
      $ sudo apt install npm

- #### Other Operating Systems
  You can find more information about the installation on the [official Node.js website](https://nodejs.org/) and the [official NPM website](https://npmjs.org/).

If the installation was successful, you should be able to run the following command.

    $ node --version
    v15.14.0

    $ npm --version
    7.10.0


## Installation

Use the package manager [npm](https://nodejs.org/en/download/) to install mid-utils.

```bash
npm install mid-utils
```

# Usage

## Array Helper

```typescript
import { ArrayHelper } from 'mid-utils';

const arrayObject = [
  {
    id: 1,
    name: 'Andy'
  },
  {
    id: 2,
    name: 'Tommy'
  }
];
```
---
### offset
```typescript
console.log(ArrayHelper.offset(arrayObject, 0));
/**
 * result
 * [
      {
        id: 1,
        name: 'Andy'
      },
      {
        id: 2,
        name: 'Tommy'
      }
    ]
 */

console.log(ArrayHelper.offset(arrayObject, 1));
/**
 * result
    [
      {
        id: 2,
        name: 'Tommy'
      }
    ]
 */
```
---
### limit
```typescript
console.log(ArrayHelper.limit(arrayObject, 1));
/**
 * result
 * [
    {
        id: 1,
        name: 'Andy'
      }
    ]
 */
```
---
### sort
```typescript
console.log(ArrayHelper.sort(arrayObject, 'name', 'DESC'));
/**
 * result
 * [
      {
        id: 2,
        name: 'Tommy'
      },
      {
        id: 1,
        name: 'Andy'
      }
    ]
 */
```

---
_Source: https://npm.io/package/mid-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
