flashy
Flashy is an express 4 middleware. It's stupid simple.. just like this README.
Install
$ npm install express-flashy
Usage
var express = require('express');
var session = require('express-session');
var flashy = require('express-flashy');
var app = express();
app.use(session());
app.use(flashy());
app.get('/flash', function(req, res) {
req.flashy('info', 'Flash messages made simple!');
res.redirect('/');
});
Then in your views (nunjucks example):
<!DOCTYPE html>
<html lang="en">
<head>
<title>Flashy</title>
</head>
<body>
{{ flashy() | safe }}
</body>
</html>
Easy, ya? :surfer:'s up!
License
The MIT License
Copyright (c) 2014 Jordan Stout <http://jrdn.org/>