New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

koa-flash2

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-flash2

Flash messages for your koa application based on connect-flash.

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
2
Weekly downloads
 
Created
Source

#koa-flash2

Flash messages for koa based on connect-flash.

Build Status Coverage Status

Installation

$ npm install koa-flash2

koa-flash2 also depends on koa-session. You must add koa-session as a middleware prior to adding koa-flash2 as seen in the example:

Example

var koa = require('koa')
  , session = require('koa-session')
  , flash = require('koa-flash2');

var app = koa();

app.keys = ['foo'];
app.use(session(app));
app.use(flash());

app.use(function *() {
  if (this.method === 'POST') {
    this.flash('error', 'This is a flash error message.');
  } else if (this.method === 'GET') {
    this.body = this.flash('error');
  }
});

app.listen(3000);

License

MIT

Keywords

FAQs

Package last updated on 12 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc