node package manager
We need your input. Help make JavaScript better: Take the 2017 JavaScript Ecosystem survey »


build status express-csrf-local

Express middleware for including the token generated by Connect's CSRF middleware in the locals object for templates.


npm install express-csrf-local


var express = require('express');
var app = express();
app.configure(function() {
  // configurations 
  // ... 
  // ... 

The string argument express-csrf-local is invoked with is the name of the local that will be contain the CSRF token. This argument is optional and if it's not provided, the name of the local will default to token.

Be sure to register the CSRF middleware before registering the middleware provided by express-csrf-token, otherwise you'll run into issues.


npm install
npm test


Found a bug? Create an issue on GitHub.


For transparency and insight into the release cycle, releases will be numbered with the follow format:


And constructed with the following guidelines:

  • Breaking backwards compatibility bumps the major
  • New additions without breaking backwards compatibility bumps the minor
  • Bug fixes and misc changes bump the patch

For more information on semantic versioning, please visit


Copyright (c) 2012 Jake Harding
Licensed under the MIT License.