Nevertheless! Party Metaphorically

npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

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

install

npm i flash

Downloadsweekly downloads

2,075

version

1.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability