8.0.1 • Published 5 months ago
koa-helmet v8.0.1
koa-helmet
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 helmet
# or:
yarn add koa-helmet 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.1.0
6 months ago
8.0.1
5 months ago
8.0.0
5 months ago
7.0.0
2 years ago
7.0.2
2 years ago
7.0.1
2 years ago
6.1.0
4 years ago
6.0.0
5 years ago
5.2.0
6 years ago
5.1.0
6 years ago
5.0.0
6 years ago
4.2.1
6 years ago
4.2.0
6 years ago
4.1.0
6 years ago
4.0.0
7 years ago
3.3.0
7 years ago
3.2.0
8 years ago
1.2.0
8 years ago
1.1.0
8 years ago
3.1.0
8 years ago
3.0.0
8 years ago
2.0.0
9 years ago
2.0.0-alpha.1
9 years ago
1.0.0
9 years ago
0.5.1
9 years ago
1.0.0-alpha.2
9 years ago
0.5.0
9 years ago
0.4.0
9 years ago
1.0.0-alpha.1
9 years ago
0.3.0
10 years ago
0.2.0
10 years ago
0.2.0-beta2
10 years ago
0.2.0-beta1
10 years ago
0.1.0
10 years ago
0.0.3
10 years ago
0.0.2
10 years ago
0.0.1
11 years ago