Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including @nest-middlewares/csurf with all npm packages installed. Try it out:

require("@nestjs/common/package.json"); // @nestjs/common is a peer dependency. var csurf = require("@nest-middlewares/csurf")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@nest-middlewares/csurf v6.0.0

NestJS Middleware for CSURF

Nest Middlewares - CSURF

Coverage Status

This is the Nest Middleware wrapper around csurf.


@nest-middlewares/csurf is available from NPM. You can install it with this command:

npm install --save @nest-middlewares/csurf


import { CsurfMiddleware } from '@nest-middlewares/csurf';

export class MyModule {
    configure(consumer: MiddlewaresConsumer) {
        // IMPORTANT! Call Middleware.configure BEFORE using it for routes
        HelmetMiddleware.configure( /* options as per helmet docs */ )
        consumer.apply(CsurfMiddleware).forRoutes( /* your routes */ );
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free