# tohash

> Array to hash by key

Latest version **1.0.2** (published 2017-09-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install tohash
pnpm add tohash
yarn add tohash
bun add tohash
```

## 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 | 2017-09-17 |
| First published | 2017-09-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | mfix22 |
| Maintainers | mfix22 |

## Links

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

## Recent versions

- 1.0.2 (latest) — 2017-09-17
- 1.0.1 — 2017-09-17
- 1.0.0 — 2017-09-16

## README

# `toHash`
Turn your list of objects into a key:value hash based on key

```javascript
const list = [
  {
    id: 1,
    name: 'Mike'
  },
  {
    id: 2,
    name: 'Nick'
  },
  {
    id: 3,
    name: 'Brian'
  },
  {
    id: 4,
    name: 'Jake'
  }
]

toHash(list, 'name') // default key is `id`
/*
{ 'Mike':  { id: 1, name: 'Mike'  },
  'Nick':  { id: 2, name: 'Nick'  },
  'Brian': { id: 3, name: 'Brian' },
  'Jake':  { id: 4, name: 'Jake'  } }
*/
```

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