Neoanthropic Preternatural Murmurings

npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

content-security-policy-builder

2.1.0 • Public • Published

Content Security Policy builder

Build Status

Take an object and turn it into a Content Security Policy string. Useful for building Content Security Policy libraries.

It can handle a lot of things you can you throw at it; camelCased or dash-separated directives, arrays or strings, et cetera.

Usage:

const builder = require('content-security-policy-builder')
 
// default-src 'self' default.com; script-src scripts.com; whatever-src something; object-src
builder({
  directives: {
    defaultSrc: ["'self'", 'default.com'],
    scriptSrc: 'scripts.com',
    'whatever-src': 'something',
    objectSrc: true
  }
})

install

npm i content-security-policy-builder

Downloadsweekly downloads

517,983

version

2.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability