# flash

> Simple flash messages for Express

Latest version **1.1.0** (published 2014-09-11) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2014-09-11 |
| First published | 2014-09-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 93 |
| Author | Jonathan Ong |
| Maintainers | jongleberry |
| Keywords | flash, messages, express |

## Links

- npm: https://www.npmjs.com/package/flash
- Repository: https://github.com/expressjs/flash
- Issues: https://github.com/expressjs/flash/issues
- npm.io page: https://npm.io/package/flash

## Recent versions

- 1.1.0 (latest) — 2014-09-11
- 1.0.1 — 2014-09-09
- 1.0.0 — 2014-09-08
- 0.0.0 — 2014-09-04

## README

# flash

[![NPM version][npm-image]][npm-url]
[![Build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![Dependency Status][david-image]][david-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]

The simplest flash implementation for Express.

## Usage

```bash
npm i flash
```

```js
app.use(session()); // session middleware
app.use(require('flash')());

app.use(function (req, res) {
  // flash a message
  req.flash('info', 'hello!');
  next();
})
```

```jade
for message in flash
  a.alert(class='alert-' + message.type)
    p= message.message
```

## API

### req.flash([type], msg)

Flash a message defaulting the `type` to `info`.

### res.locals.flash

An array of flash messages of the form:

```json
{
  "type": "info",
  "message": "message"
}
```

[npm-image]: https://img.shields.io/npm/v/flash.svg?style=flat-square
[npm-url]: https://npmjs.org/package/flash
[github-tag]: http://img.shields.io/github/tag/expressjs/flash.svg?style=flat-square
[github-url]: https://github.com/expressjs/flash/tags
[travis-image]: https://img.shields.io/travis/expressjs/flash.svg?style=flat-square
[travis-url]: https://travis-ci.org/expressjs/flash
[coveralls-image]: https://img.shields.io/coveralls/expressjs/flash.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/expressjs/flash?branch=master
[david-image]: http://img.shields.io/david/expressjs/flash.svg?style=flat-square
[david-url]: https://david-dm.org/expressjs/flash
[license-image]: http://img.shields.io/npm/l/flash.svg?style=flat-square
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/flash.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/flash
[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square
[gittip-url]: https://www.gittip.com/jonathanong/

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