csp-toolkit
TypeScript icon, indicating that this package has built-in type declarations

1.3.2 • Public • Published

CSP Toolkit

npm version npm downloads npm weekly downloads License GitHub stars

A comprehensive toolkit for working with Content Security Policy (CSP) directives in TypeScript. Provides strongly-typed CSP keys, categorized directives, and utility functions to simplify CSP creation and manipulation.

Features

  • Typed CSP Directives: Access categorized CSP directive types, including experimental, official, and navigation directives.
  • Utility Functions: Easily generate CSP key-value maps and convert them into string policies.
  • Extensible: Designed for flexibility and future expansion.

Usage

import {mergePolicies, CSPPolicy, policyToString} from "csp-toolkit"

Package Sidebar

Install

npm i csp-toolkit

Weekly Downloads

3,703

Version

1.3.2

License

GPL-3.0-only

Unpacked Size

52.8 kB

Total Files

27

Last publish

Collaborators

  • tsotrocki