# propprop

> Just a helper for plucking a property out of an object.

Latest version **0.3.1** (published 2016-07-12) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2016-07-12 |
| First published | 2014-04-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Stephen Sawchuk |
| Maintainers | stephenplusplus |
| Keywords | prop, property, pluck |

## Links

- npm: https://www.npmjs.com/package/propprop
- Repository: https://github.com/stephenplusplus/propprop
- Homepage: https://github.com/stephenplusplus/propprop#readme
- Issues: https://github.com/stephenplusplus/propprop/issues
- npm.io page: https://npm.io/package/propprop

## Recent versions

- 0.3.1 (latest) — 2016-07-12
- 0.3.0 — 2014-04-14
- 0.2.0 — 2014-04-08
- 0.1.0 — 2014-04-07

## README

# propprop
> pluck a property out of an object.


#### Before
```js
var friendsAsJavaScriptLibraries = [
  {
    name: 'passy.js',
    hobby: 'clay'
  },
  {
    name: 'sindre.js',
    vehicle: 'unicorn taxi'
  },
  {
    name: 'addy.js',
    invented: 'google *'
  }
];

var names = friendsAsJavaScriptLibraries.map(function (item) {
  return item.name;
});
```

#### After
```js
var friendsAsJavaScriptLibraries = [ /* ... */ ];

var names = friendsAsJavaScriptLibraries.map(prop('name'));
```

The benefit is more noticeable when you're using multiple [Array.prototype](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/prototype) methods to shape your objects:

```js
var friendsAsJavaScriptLibraries = [ /* ... */ ];
var urls;

if (friendsAsJavaScriptLibraries.every(prop('name'))) {
  urls = friendsAsJavaScriptLibraries
    .map(function (item) {
      item.url = 'https://github.com/magical-library-land/' + item.name;
      return item;
    })
    .map(prop('url'));
}
```


## Why?
Perhaps you're already using [Lo-Dash](http://lodash.com), [Underscore.js](http://underscorejs.org), or another utility library. This should not supplement those libraries, and definitely cannot replace. This is better suited towards applications that don't want to carry the weight and/or functionality of such libraries, and just want something simple and modular.


## Install
`prop` can be used in the browser or within your Node.js apps.

#### Browser
```bash
$ bower install --save propprop
```
```html
<script src="bower_components/propprop/browser.js"></script>
```

#### Node.js
```bash
$ npm install --save propprop
```
```js
var prop = require('propprop');
```


## License

[MIT](http://opensource.org/licenses/MIT) © [Stephen Sawchuk](http://sawchuk.me)

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