# @sumeetr/indexer

> Simple utility to index an array of objects

Latest version **0.2.0** (published 2019-09-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install @sumeetr/indexer
pnpm add @sumeetr/indexer
yarn add @sumeetr/indexer
bun add @sumeetr/indexer
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2019-09-18 |
| First published | 2019-09-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Sumeet Raisinghani |
| Maintainers | sumeetr |
| Keywords | indexer |

## Links

- npm: https://www.npmjs.com/package/@sumeetr/indexer
- Repository: https://github.com/SumeetR/indexer
- Homepage: https://github.com/SumeetR/indexer#readme
- Issues: https://github.com/SumeetR/indexer/issues
- npm.io page: https://npm.io/package/@sumeetr/indexer

## Recent versions

- 0.2.0 (latest) — 2019-09-18
- 0.1.3 — 2019-09-18
- 0.1.2 — 2019-09-18

## README

# Indexer

## Installation
npm install --save @sumeetr/indexer

## Usage
```typescript
import {Indexed, indexArray} from '@sumeetr/indexer';

interface ArrayItem {
    id: number;
    name: string;
}

const array: ArrayItem[] = [
    {id: 0, name: 'Kurt'},
    {id: 1, name: 'Krist'},
    {id: 2, name: 'Dave'},
    {id: 3, name: 'Pat'}
];

console.log(array);
// [{id: 0, name: 'Kurt'}, {id: 1, name: 'Krist'}, {id: 2, name: 'Dave'}, {id: 3, name: 'Pat'}]

const indexedArray: Indexed<ArrayItem> = indexArray(array);

console.log(indexedArray);
// {0: {id: 0, name: 'Kurt'}, 1: {id: 1, name: 'Krist'}, 2: {id: 2, name: 'Dave'}, 3: {id: 3, name: 'Pat'}}
```

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