# ejs-flash

> A middleware to send flash messages to the client

Latest version **1.0.3** (published 2019-02-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install ejs-flash
pnpm add ejs-flash
yarn add ejs-flash
bun add ejs-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.0.3 |
| Published | 2019-02-08 |
| First published | 2019-02-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 2.2 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Kie |
| Maintainers | kieiswillsmith |
| Keywords | ejs, flash |

## Links

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

## Dependencies (2)

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

## Recent versions

- 1.0.3 (latest) — 2019-02-08
- 1.0.2 — 2019-02-08
- 1.0.1 — 2019-02-08
- 1.0.0 — 2019-02-08

## README

ejs-flash
=========

A module for making flash messages using the EJS view engine in Express

Examples
--------

### Express Examples

#### Basic

```javascript
res.flash('index',
  {
    type: 'error',
    message: 'An error occured!'
  }
);
```

#### Extra Options

```javascript
res.flash('index',
  {
    type: 'error',
    message: 'An error occured, here are the details:...',
    title: 'An error occured!',
    class: 'alert error',
    id: '123456789'
  }
);
```

### EJS Examples

#### Basic

```ejs
<% if (flash) { %>
  <% if (flash.type === 'error') { %>
    <p class="alert error">Error: <%= flash.message %></p>
  <% } %>
<% } %>
```

#### Extra Options

```html
<% if (flash) { %>
  <% if (flash.type === 'error') { %>
    <h1><%= flash.title %></h1>
    <p class="<%= flash.class %>">Error: <%= flash.message %></p>
    <code>ID: <%= flash.id %></code>
  <% } %>
<% } %>
```

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