7.0.2 • Published 1 year ago

koa-helmet v7.0.2

Weekly downloads
135,842
License
MIT
Repository
github
Last release
1 year ago

koa-helmet

Version Dependency Status js-semistandard-style Downloads

koa-helmet is a wrapper for helmet to work with koa. It provides important security headers to make your app more secure by default.

Installation

npm i koa-helmet

# or:

yarn add koa-helmet

Usage

Usage is the same as helmet

Helmet offers 11 security middleware functions:

// This...
app.use(helmet());

// ...is equivalent to this:
app.use(helmet.contentSecurityPolicy());
app.use(helmet.dnsPrefetchControl());
app.use(helmet.expectCt());
app.use(helmet.frameguard());
app.use(helmet.hidePoweredBy());
app.use(helmet.hsts());
app.use(helmet.ieNoOpen());
app.use(helmet.noSniff());
app.use(helmet.permittedCrossDomainPolicies());
app.use(helmet.referrerPolicy());
app.use(helmet.xssFilter());

You can see more in the documentation.

Example

import Koa from 'koa';
import helmet from 'koa-helmet';

const app = new Koa();

app.use(helmet());

app.use((ctx) => {
  ctx.body = "Hello World"
});

app.listen(4000);

Testing

To run the tests, simply run

npm test

Versioning

  • koa-helmet >=2.x (master branch) supports koa 2.x
  • koa-helmet 1.x (koa-1 branch) supports koa 0.x and koa 1.x
7.0.0

1 year ago

7.0.2

1 year ago

7.0.1

1 year ago

6.1.0

3 years ago

6.0.0

4 years ago

5.2.0

5 years ago

5.1.0

5 years ago

5.0.0

5 years ago

4.2.1

5 years ago

4.2.0

5 years ago

4.1.0

5 years ago

4.0.0

6 years ago

3.3.0

6 years ago

3.2.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

3.1.0

7 years ago

3.0.0

7 years ago

2.0.0

8 years ago

2.0.0-alpha.1

8 years ago

1.0.0

8 years ago

0.5.1

8 years ago

1.0.0-alpha.2

8 years ago

0.5.0

8 years ago

0.4.0

8 years ago

1.0.0-alpha.1

8 years ago

0.3.0

9 years ago

0.2.0

9 years ago

0.2.0-beta2

9 years ago

0.2.0-beta1

9 years ago

0.1.0

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

10 years ago