JSPM

content-security-policy-parser

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

Parse Content Security Policy directives.

Package Exports

  • content-security-policy-parser

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

Build Status

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']
}
*/