# express-locals

> Mixin properties into the `res.locals` object for each request

Latest version **1.0.1** (published 2015-02-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install express-locals
pnpm add express-locals
yarn add express-locals
bun add express-locals
```

## 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 | 2015-02-23 |
| First published | 2015-02-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| Author | John Fawcett |
| Maintainers | johndotawesome |
| Keywords | Express, Middleware, Locals |

## Links

- npm: https://www.npmjs.com/package/express-locals
- Repository: https://github.com/goodybag/express-locals
- Issues: https://github.com/goodybag/express-locals/issues
- npm.io page: https://npm.io/package/express-locals

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^3.3.0
- [express](https://npm.io/package/express.md) ^4.11.2
- [supertest](https://npm.io/package/supertest.md) ^0.15.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2015-02-23

## README

# Express Locals

> Mixin properties into the `res.locals` object for each request

__Usage__

```javascript
app.get('/my-route'
, require('express-locals')({
    hello: 'world'
  , objects: [{ a: 1 }, { a: 2 }, a: 3 }]
  })
, function( req, res ){
    res.send( res.locals.hello );
  }
);
```

__Install__

```
npm i -S express-locals
```

__Test__

```
npm test
```

## Options

```javascript
{
  // Deep clones the passed in object at each request
  cloneDeep: true // (default)
}
```

__usage:__

```javascript
app.get('/my-route'
, require('expresss-locals')({ a: 1 }, { cloneDeep: false })
, myHandler
);
```

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