# fastify-expect-ct

> Fastify plugin to set the Expect-CT header

Latest version **0.3.0** (published 2018-07-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install fastify-expect-ct
pnpm add fastify-expect-ct
yarn add fastify-expect-ct
bun add fastify-expect-ct
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2018-07-06 |
| First published | 2018-05-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 6 |
| Dependencies | 1 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | PoppinL |
| Maintainers | poppinl |
| Keywords | fastify, fastify-plugin, helmet, expect-ct |

## Links

- npm: https://www.npmjs.com/package/fastify-expect-ct
- Repository: https://github.com/poppinlp/fastify-expect-ct
- Homepage: https://github.com/poppinlp/fastify-expect-ct#readme
- Issues: https://github.com/poppinlp/fastify-expect-ct/issues
- npm.io page: https://npm.io/package/fastify-expect-ct

## Dependencies (1)

- [fastify-plugin](https://npm.io/package/fastify-plugin.md) ^1.2.0

## Recent versions

- 0.3.0 (latest) — 2018-07-06
- 0.2.0 — 2018-06-08
- 0.1.0 — 2018-05-30

## README

# fastify-expect-ct

[![Build Status][ci-img]][ci-url]
[![Code coverage][cov-img]][cov-url]
[![Code style][lint-img]][lint-url]
[![Dependency Status][dep-img]][dep-url]
[![Dev Dependency Status][dev-dep-img]][dev-dep-url]
[![NPM version][npm-ver-img]][npm-url]
[![NPM downloads][npm-dl-img]][npm-url]
[![NPM license][npm-lc-img]][npm-url]

Fastify plugin to set the Expect-CT header

## Why?

You may know [expect-ct](https://github.com/helmetjs/expect-ct) as a [expect-ct middleware](https://helmetjs.github.io/docs/expect-ct/) used in [helmet](https://github.com/helmetjs/helmet). And you could use it as a middleware in fastify also. So why i made this plugin?

You may find the reason in [benchmark result](./benchmarks/benchmark.txt) and wish you like it. :)

## Difference

This plugin has passed all [expect-ct](https://github.com/helmetjs/expect-ct) test cases.
And no difference in options.

## Install

Via npm:

```shell
npm i fastify-expect-ct
```

Via yarn:

```shell
yarn add fastify-expect-ct
```

## Usage

```js
const fastify = require('fastify');
const fastifyExpectCt = require('fastify-expect-ct');

const app = fastify();
app.register(fastifyExpectCt, {
  // Your options
});

app.listen(3000, err => {
  if (err) throw err;
});
```

## Options

This plugin has the same options as the middleware in helmet.

### maxAge {number}

Set `max-age` in header. Default is `0`. Plugin will use default value if you passed in a non-numeric value.

### enforce {boolean}

Set `enforce` value in header. Default is `false`.

### reportUri {string}

Set `reportUri` value in header. Default is empty.

## Changelog

- 0.3.0
  - Use expect-ct test cases
- 0.2.0
  - Add test case
  - Add code coverage
  - Add benchmarks
- 0.1.0:
  - Init version

[ci-img]: https://img.shields.io/travis/poppinlp/fastify-expect-ct.svg?style=flat-square
[ci-url]: https://travis-ci.org/poppinlp/fastify-expect-ct
[cov-img]: https://img.shields.io/coveralls/poppinlp/fastify-expect-ct.svg?style=flat-square
[cov-url]: https://coveralls.io/github/poppinlp/fastify-expect-ct?branch=master
[lint-img]: https://img.shields.io/badge/code%20style-handsome-brightgreen.svg?style=flat-square
[lint-url]: https://github.com/poppinlp/eslint-config-handsome
[dep-img]: https://img.shields.io/david/poppinlp/fastify-expect-ct.svg?style=flat-square
[dep-url]: https://david-dm.org/poppinlp/fastify-expect-ct
[dev-dep-img]: https://img.shields.io/david/dev/poppinlp/fastify-expect-ct.svg?style=flat-square
[dev-dep-url]: https://david-dm.org/poppinlp/fastify-expect-ct#info=devDependencies
[npm-ver-img]: https://img.shields.io/npm/v/fastify-expect-ct.svg?style=flat-square
[npm-dl-img]: https://img.shields.io/npm/dm/fastify-expect-ct.svg?style=flat-square
[npm-lc-img]: https://img.shields.io/npm/l/fastify-expect-ct.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/fastify-expect-ct

---
_Source: https://npm.io/package/fastify-expect-ct · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
