# property-handlers

> Utility for mapping object properties to handler functions

Latest version **1.1.1** (published 2016-07-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install property-handlers
pnpm add property-handlers
yarn add property-handlers
bun add property-handlers
```

## 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.1 |
| Published | 2016-07-19 |
| First published | 2014-02-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Patrick Steele-Idem |
| Maintainers | pnidem |
| Keywords | utlity, object, properties, handler, functions |

## Links

- npm: https://www.npmjs.com/package/property-handlers
- Repository: https://github.com/patrick-steele-idem/property-handlers
- Issues: https://github.com/patrick-steele-idem/property-handlers/issues
- npm.io page: https://npm.io/package/property-handlers

## Recent versions

- 1.1.1 (latest) — 2016-07-19
- 1.1.0 — 2016-07-13
- 1.0.1 — 2015-04-24
- 1.0.0 — 2014-09-22
- 0.2.2-beta — 2014-04-14
- 0.2.1-beta — 2014-03-04
- 0.2.0-beta — 2014-02-26
- 0.1.0 — 2014-02-26

## README

property-handlers
=================

# Installation
```
npm install property-handlers --save
```

# Usage
```javascript
var propertyHandlers = require('property-handlers');
propertyHandlers(object, handlers, path);
```

## Arguments
* `object`: An object with properties
* `handlers`: An object with properties that correspond to allowed properties. The value of each property should be a handler `function`
* `path`: Used for error reporting

## Example:
```javascript
var object = {
    foo: 'foo',
    bar: 'bar'
};

propertyHandlers(
    object,
    {
        foo: function(value) {
            // value === 'foo'
        },

        bar: function(value) {
            // bar === 'bar'
        }
    },
    'some path');
```

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