# pluck-util

> Extract a list of property values from a collection.

Latest version **1.0.4** (published 2022-03-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install pluck-util
pnpm add pluck-util
yarn add pluck-util
bun add pluck-util
```

## 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.4 |
| Published | 2022-03-24 |
| First published | 2020-02-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jonathan Kemp |
| Maintainers | jonkemp |
| Keywords | array, object, pluck, map, utility, util |

## Links

- npm: https://www.npmjs.com/package/pluck-util
- Repository: https://github.com/jonkemp/pluck-util
- Homepage: https://github.com/jonkemp/pluck-util#readme
- Issues: https://github.com/jonkemp/pluck-util/issues
- npm.io page: https://npm.io/package/pluck-util

## Dependencies (1)

- [@jonkemp/package-utils](https://npm.io/package/@jonkemp/package-utils.md) ^1.0.8

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2022-03-24
- 1.0.3 — 2020-11-08
- 1.0.2 — 2020-03-29
- 1.0.1 — 2020-02-17
- 1.0.0 — 2020-02-17
- 1.0.0-alpha — 2020-02-17

## README

# pluck-util ![Build Status](https://github.com/jonkemp/pluck-util/actions/workflows/main.yml/badge.svg?branch=master)

> Extract a list of property values from a collection.

A convenient version of what is perhaps the most common use-case for map. 

Inspired by `_.pluck`. 😄


## Install

Install with [npm](https://npmjs.org/package/pluck-util)

```
$ npm install pluck-util
```

Or [unpkg](https://unpkg.com/pluck-util/)

```
<script src="https://unpkg.com/pluck-util@1.0.2/umd/index.js" />
```

Check out the unit tests on [CodePen](https://codepen.io/jonkemp/full/KKpzYzz).

## Usage

```js
const pluck = require('pluck-util');

const stooges = [{name: 'moe', age: 40}, {name: 'larry', age: 50}, {name: 'curly', age: 60}];

pluck(stooges, 'name');
//=> ['moe', 'larry', 'curly']

pluck(stooges, 'age');
//=> [40, 50, 60]
```

---
| **Like us a lot?** Help others know why you like us! **Review this package on [pkgreview.dev](https://pkgreview.dev/npm/pluck-util)** | ➡   | [![Review us on pkgreview.dev](https://i.ibb.co/McjVMfb/pkgreview-dev.jpg)](https://pkgreview.dev/npm/pluck-util) |
| ----------------------------------------------------------------------------------------------------------------------------------------- | --- | --------------------------------------------------------------------------------------------------------------------- |

## API

### pluck(collection, propertyName)

#### collection

Type: `array`  
Default: `none`

The array to iterate over.

#### propertyName

Type: `string`  
Default: `none`

The property name to extract.

## License

MIT

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