# @webstyle/expresshooks

> Express.js hooks

Latest version **1.0.1** (published 2019-03-05) · 0 weekly downloads

## Install

```sh
npm install @webstyle/expresshooks
pnpm add @webstyle/expresshooks
yarn add @webstyle/expresshooks
bun add @webstyle/expresshooks
```

## 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.1 |
| Published | 2019-03-05 |
| First published | 2019-03-05 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.1 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | webstyle |
| Maintainers | webstyle |

## Links

- npm: https://www.npmjs.com/package/@webstyle/expresshooks
- Repository: https://github.com/WebStyle/express-hooks
- Homepage: https://github.com/WebStyle/express-hooks#readme
- Issues: https://github.com/WebStyle/express-hooks/issues
- npm.io page: https://npm.io/package/@webstyle/expresshooks

## Dependencies (1)

- [express](https://npm.io/package/express.md) 4.16.4

## Recent versions

- 1.0.1 (latest) — 2019-03-05
- 1.0.0 — 2019-03-05

## README

# Express.js routing lifecycle hooks

## Installation
```bash
npm i @webstyle/expresshooks --save
```


### before
```js
const { before } = require('expresshooks');

async function logger() {
    // your code here....
    return true;
}

// Add before hook as middleware 
app.get("/", before(logger), function(req, res) {
  return res.send("Hello world");
});
```

### after
```js
const { after } = require('expresshooks');

async function logger(response) {
    // your code here...
    return true;
}

// Add after hook as middleware 
app.get("/", before(logger), function(req, res) {
  return res.send("Hello world");
});
```

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