# simple-csp

> Very simple Content Security Policy manager

Latest version **0.2.0** (published 2023-09-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-csp
pnpm add simple-csp
yarn add simple-csp
bun add simple-csp
```

## Health

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

Positive: has types; no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2023-09-11 |
| First published | 2023-09-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ståle Raknes |
| Maintainers | starak |
| Keywords | content, security, policy, csp |

## Links

- npm: https://www.npmjs.com/package/simple-csp
- npm.io page: https://npm.io/package/simple-csp

## Alternatives

- [ext-list](https://npm.io/package/ext-list.md) — 6.3M weekly downloads
- [@lexical/selection](https://npm.io/package/@lexical/selection.md) — 3.8M weekly downloads
- [@lexical/text](https://npm.io/package/@lexical/text.md) — 3.6M weekly downloads
- [@lexical/clipboard](https://npm.io/package/@lexical/clipboard.md) — 3.0M weekly downloads
- [@tiptap/extension-mention](https://npm.io/package/@tiptap/extension-mention.md) — 3.0M weekly downloads

## Recent versions

- 0.2.0 (latest) — 2023-09-11
- 0.1.2 — 2023-09-11

## README

## Very simple Content Security Policy (CSP) manager


**Usage**

	var express = require( 'express' );
	var app = express();
	var csp = require( "simple-csp" );
	
	var csp_headers = {
        "default-src": ["'self'", "http://example.com"],
        "connect-src": ["'self'", "http://example.com"],
        "img-src": ["'self'", "data:", "http://example.com"]
    };
	
	app.use( "/", function ( req, res, done ) {
        csp.header( csp_headers, res );
        done();
    } );

    // Static files from ./public
    app.use( "/", express.static( "./public" ) );
    
    app.listen( 8888 );

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