npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@arachnodex/job-csp-report

v1.0.1

Published

Arachnodex job for generating Content Security Policy header reports.

Readme

@arachnodex/job-csp-report

Beta: This job is in beta and has not been fully tested. Review all generated directives carefully before deploying them.

Generate Content Security Policy header directives from observed Arachnodex crawl data.

npm install @arachnodex/job-csp-report

Run it with the Arachnodex crawler:

arachnodex -j csp-report

By default the job scans crawled HTML plus same-site CSS and JavaScript bodies, outputs both Content-Security-Policy-Report-Only and Content-Security-Policy, and formats directives for Apache mod_headers.

Switches

| Switch | Description | | --- | --- | | -V, --version | Output the job version and terminate. | | -o <format>, --output=<format> | Output format: apache, nginx, lighttpd, or raw. | | --no-nested | Disable nested same-site CSS/JS scanning. | | --unsafe-inline | Add 'unsafe-inline' for observed inline script/style usage. | | -p, --prompt | After the normal report, output copy/paste agent prompts for each warning group. | | -h, --help | Show job help. |

Notes

The generated CSP is based on crawl observations. It is a strong starting policy, not proof that every runtime dependency was observed. A crawl with no scanned HTML pages is reported as an alert rather than a clean result.

Relative resource URLs honor the document's <base href>. External base URLs are preserved for compatibility and reported as risky. Forms without an explicit action contribute 'self' to form-action. Non-executable script data blocks such as JSON-LD and social metadata URLs are not treated as CSP-loaded resources.

Inline script/style/event handler usage is reported as a hardening item. Without --unsafe-inline, inline usage is not automatically allowed.

Config

Default config:

{
  "emailReportEnabled": true,
  "outputFormat": "apache",
  "nested": true,
  "unsafeInline": false,
  "includeReportOnly": true,
  "includeEnforce": true,
  "reportUri": "",
  "reportTo": "",
  "ignorePatterns": [],
  "additionalSources": {},
  "ignoreSources": {},
  "staticDirectives": {
    "default-src": ["'self'"],
    "base-uri": ["'self'"],
    "frame-ancestors": ["'self'"]
  }
}

| Setting | Type | Default | Description | | --- | --- | --- | --- | | emailReportEnabled | boolean | true | Allows this job to contribute its report to configured Arachnodex report email output. | | outputFormat | string | "apache" | Header format: apache, nginx, lighttpd, or raw. | | nested | boolean | true | Fetch and scan same-site CSS/JS files observed in crawled pages, with up to four nested requests in flight. | | unsafeInline | boolean | false | Add 'unsafe-inline' to script-src/style-src when matching inline usage is observed. Inline usage is still reported. | | includeReportOnly | boolean | true | Emit Content-Security-Policy-Report-Only. | | includeEnforce | boolean | true | Emit Content-Security-Policy. | | reportUri | string | "" | Optional report-uri CSP directive value. Omitted when empty. | | reportTo | string | "" | Optional report-to CSP directive value. Omitted when empty. | | ignorePatterns | string[] | [] | Page/document URL regular expressions to exclude from this CSP report. Matching pages are not counted, their HTML resources are ignored, and their same-site nested CSS/JS assets are not queued from that page. Patterns are tested against full URL, path plus query, path, and decoded path forms. | | additionalSources | object | {} | Extra CSP sources keyed by directive, for sources that were not observed but must be allowed. | | ignoreSources | object | {} | Exact CSP sources to omit, keyed by directive or *. This also applies to static and automatically added sources, so review removals carefully. | | staticDirectives | object | default safe directives | Fixed directives included in every generated policy. |

Example section-specific CSP exclusion:

{
  "ignorePatterns": [
    "/enews/",
    "past-newsletters",
    "/digital-catalog/",
    "1stmonday"
  ]
}

Use crawler-level urlCantContain / urlMustContain when a URL should be excluded from the whole crawl and every job. Use this job's ignorePatterns when the URL should still be available to other jobs, but should not influence the generated CSP for the current policy scope.