8.0.1 • Published 5 months ago

koa-helmet v8.0.1

Weekly downloads
135,842
License
MIT
Repository
github
Last release
5 months ago

koa-helmet

Version 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 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
@danielhuisman/koa-base@vulcan/corehbbsvrcore@lbu/koa@framework100500/platform-koa@mote/core@deity/falcon-client@rappopo/cuk-security@harmonizly/treehousedream_reason_koa-cli@infinitebrahmanuniverse/nolb-koa-hmyfiteco-api@everything-registry/sub-chunk-2022dream_reason-koa-clitea-helperstest-mlr-libraryteapackage-tatespoorman297super-projectstaple-serverstrapi-boing-globalstrapi-manager-core-strapistrapi-maxiphysutakkusupergirlsvcdthink-helmetvrayvapid-clivapid-cli-next@ditojs/server@cran/koa.core@cran/lib.koa.core@deuterium/koa@dolan-x/api-server@dolan-x/server@blueprod/ws-koaismetjsjollofkakojsisomorphic-flux-boilerplatekoa-frameworkkoa-pluskoa-protectkoa-colakoa-creatorkoa-micro-tskoa-midkoa-serverless-readykoa-web-kit@netzo/api@ai-lion/lion-free-proxystudy-gaiajssouljsstreaming-apiucell_b2c_apitmkoa@amit_g0swami/service-client@antgineering-studio/strapi@augejs/koa-security@b-mo/http-server@bimbeo160/strapi@blended/starter@besh/koa-bootstraps@cat-org/default-middleware@cat-org/koa-base@36node/kanban@36node/template-service@4lch4/api-starter@2o3t-core/plugin-third-party@abacollection/web@brad-jones/cc-tokenizer-server@dh-core/core@digicms/cms@digicommerce/cms@digest/koa@daniellehuisman/koa-base@coolcoffee/strapi@crapy/crapy@danhuyenphan/strapizan-nodezaorayehanyanxiu-yzb-serverymnodeyakuza0ys0-serverxshan-envuniversal-appunikornzjejs-framework@eakerzt/koa-smart@greenrenge/moleculer-iam-core@h-cli/ui-server@headnhead/astra-framework@hedviginsurance/web-survival-kit@huiweitech/matrix@iguhealth/server@ifake/pkg-ui@fjedi/rest-api@flowbuild/workflow
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