# cspeasy-express

> A simple way to setup Content Security Policy even with inline scripts and styles on express!

Latest version **0.2.0** (published 2018-06-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install cspeasy-express
pnpm add cspeasy-express
yarn add cspeasy-express
bun add cspeasy-express
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2018-06-18 |
| First published | 2018-06-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | jamesrichford |

## Links

- npm: https://www.npmjs.com/package/cspeasy-express
- Repository: https://github.com/jamesadarich/cspeasy
- Homepage: https://github.com/jamesadarich/cspeasy/blob/master/express/README.md
- Issues: https://github.com/jamesadarich/cspeasy/issues
- npm.io page: https://npm.io/package/cspeasy-express

## Dependencies (1)

- [cspeasy](https://npm.io/package/cspeasy.md) ^0.4.0

## Recent versions

- 0.2.0 (latest) — 2018-06-18
- 0.1.0 — 2018-06-17

## README

# cspeasy-express

A simple way to setup Content Security Policy even with inline scripts and styles in express!

It digests HTML documents so you can have a strong CSP with necessary inline scripts and styles (e.g. Google Analytics).

## Example

`npm install cspeasy-express --save`

```javascript
import express from "express";
import { resolve } from "path";
import { Policies } from "cspeasy";
import { createContentSecurityPolicy } from "cspeasy-express";

const app = express();

app.use(createContentSecurityPolicy({
    defaultSrc: Policies.None,
    documents: [ resolve("test/index.html") ]
}));

app.use((request, response) => {
    response.sendFile(resolve("test/index.html"));
});

const port = 3000;

app.listen(port, () => console.log(`listening on port ${port}`));
```

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