# proxyfn

> Add **use** `pre-processing` functionality to any function.

Latest version **0.1.0** (published 2015-07-27) · MIT license · 0 weekly downloads

## Install

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

## 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.1.0 |
| Published | 2015-07-27 |
| First published | 2015-07-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Colin Milhench |
| Maintainers | cmilhench |

## Links

- npm: https://www.npmjs.com/package/proxyfn
- npm.io page: https://npm.io/package/proxyfn

## Recent versions

- 0.1.0 (latest) — 2015-07-27

## README

# proxyfn

> Add **use** `pre-processing` functionality to any function.


## Install

```
$ npm install proxyfn --save
```


## Usage

```
var proxyfn = require('proxyfn');
var get = proxyfn(http.get);

get.use(function (options, callback, next) {
  if (options === 'http://www.google.com') {
    return callback({ statusCode: 404 });
  }
  return next(null, options, callback);
});
```

```
get('http://www.google.com', function (res) {
  assert.equal(res.statusCode, 404);
});

get('http://www.google.co.uk', function (res) {
  assert.equal(res.statusCode, 200);
});
```



## License

MIT © [Colin Milhench](http://milhen.ch)

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