JSPM

content-security-policy-parser

0.4.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 132380
  • Score
    100M100P100Q173737F
  • License MIT

Parse Content Security Policy directives.

Package Exports

  • content-security-policy-parser
  • content-security-policy-parser/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (content-security-policy-parser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Content Security Policy parser

Take a Content Security Policy string and parse it.

Usage:

const parse = require("content-security-policy-parser");

parse(
  "default-src 'self'; script-src 'unsafe-eval' scripts.com; object-src; style-src styles.biz"
);
/*
{
  'default-src': ["'self'"],
  'script-src': ["'unsafe-eval'", 'scripts.com'],
  'object-src': [],
  'style-src': ['styles.biz']
}
*/

This module is considered "complete". I expect to continue maintenance if needed, but I don't plan to add features or make breaking changes.