flash
Simple flash messages for Express
Last updated 6 years ago by jongleberry .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install flash 
SYNC missed versions from official npm registry.

flash

NPM version Build status Test coverage Dependency Status License Downloads

The simplest flash implementation for Express.

Usage

npm i flash
app.use(session()); // session middleware
app.use(require('flash')());

app.use(function (req, res) {
  // flash a message
  req.flash('info', 'hello!');
  next();
})
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:

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

Current Tags

  • 1.1.0                                ...           latest (6 years ago)

4 Versions

  • 1.1.0                                ...           6 years ago
  • 1.0.1                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
  • 0.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 9
This Month 9
Last Day 1
Last Week 6
Last Month 20
Dependencies (0)
None
Dev Dependencies (5)

Copyright 2014 - 2016 © taobao.org |