# methmeth

> Execute a method out from an object.

Latest version **1.1.0** (published 2015-07-30) · MIT license · 0 weekly downloads

## Install

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

## 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.1.0 |
| Published | 2015-07-30 |
| First published | 2014-04-15 |
| 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, method, meth, execute, array, iterator |

## Links

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

## Recent versions

- 1.1.0 (latest) — 2015-07-30
- 1.0.0 — 2015-07-21
- 0.1.0 — 2014-04-15

## README

# methmeth
> Call a method on an object in an Array.prototype callback.


```sh
$ npm install --save methmeth
```
```js
var meth = require('methmeth');

var friends = [
  {
    name: 'passy',
    hobby: 'carrots',
    getInfo: function () {
      return this.name + ' likes ' + this.hobby;
    }
  },
  {
    name: 'sindre',
    vehicle: 'unicorn taxi',
    getInfo: function () {
      return this.name + ' drives a ' + this.vehicle;
    }
  },
  {
    name: 'addy',
    invented: 'google *',
    getInfo: function () {
      return this.name + ' created ' + this.invented;
    }
  }
];
```

#### Before
```js
var myFriends = friends.map(function (item) {
  return item.getInfo();
}).join('\n');
// passy likes carrots
// sindre drives a unicorn taxi
// addy created google *
```

#### After
```js
friends.map(meth('getInfo')).join('\n');
// passy likes carrots
// sindre drives a unicorn taxi
// addy created google *
```

#### Pre-fill arguments
```js
var friends = [
  {
    name: 'dave',
    passion: 'dried mango',
    getInfo: function (emotion) {
      return this.name + ' loves ' + this.passion + emotion;
    }
  }
];

friends.map(meth('getInfo', '!!!!')).join('\n');
// dave loves dried mango!!!!
```

#### Related

- [propprop](https://github.com/stephenplusplus/propprop) - Pluck a property out of an object in an Array.prototype callback.

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