# keyed-array

> Recursively add named keys to arrays of objects

Latest version **2.1.2** (published 2016-11-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install keyed-array
pnpm add keyed-array
yarn add keyed-array
bun add keyed-array
```

## 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 | 2.1.2 |
| Published | 2016-11-15 |
| First published | 2016-07-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Zeke Sikelianos |
| Maintainers | zeke |
| Keywords | array, object, convenience, tree, walk, iterate, key, names |

## Links

- npm: https://www.npmjs.com/package/keyed-array
- Repository: https://github.com/zeke/keyed-array
- Homepage: https://github.com/zeke/keyed-array#readme
- Issues: https://github.com/zeke/keyed-array/issues
- npm.io page: https://npm.io/package/keyed-array

## Recent versions

- 2.1.2 (latest) — 2016-11-15
- 2.1.1 — 2016-11-15
- 2.1.0 — 2016-08-17
- 2.0.0 — 2016-07-13
- 1.0.0 — 2016-07-08

## README

# keyed-array [![Build Status](https://travis-ci.org/zeke/keyed-array.svg?branch=master)](https://travis-ci.org/zeke/keyed-array)

Recursively add named keys to arrays of objects

I wrote a blog post about the idea here: http://zeke.sikelianos.com/keyed-arrays-in-javascript

## Installation

```sh
npm install keyed-array --save
```

## Usage

For more extensive usage examples, see [test.js](test.js)

```js
const keyedArray = require('keyed-array')

let people = [
  {id: 'bob', name: 'Bob', isCool: false},
  {id: 'sue', name: 'Sue', isCool: false},
  {id: 'hal', name: 'Hal', isCool: true},
  {id: 'ann', name: 'Ann', isCool: true}
]

people = keyedArray(people)

// `people` is still an array, but now it also has keys based on the `id`
// value of each object
people.bob
// {id: 'bob', name: 'Bob', isCool: false}
```


## Tests

```sh
npm install
npm test
```

## Dependencies

None

## Dev Dependencies

- [standard](https://github.com/feross/standard): JavaScript Standard Style
- [tap-spec](https://github.com/scottcorgan/tap-spec): Formatted TAP output like Mocha&#39;s spec reporter
- [tape](https://github.com/substack/tape): tap-producing test harness for node and browsers


## License

MIT

_Generated by [package-json-to-readme](https://github.com/zeke/package-json-to-readme)_

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