flash

1.1.0 • Public • Published

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"
}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    1,476
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    1,476
  • 1.0.1
    1
  • 1.0.0
    3
  • 0.0.0
    1

Package Sidebar

Install

npm i flash

Weekly Downloads

1,481

Version

1.1.0

License

MIT

Last publish

Collaborators

  • jongleberry