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

@orlalabs/kovar

v0.7.0

Published

Security testing assertions for Playwright

Downloads

787

Readme

Kovar

Security regression tests that live inside your Playwright suite.

Swap one import, add one expect, and a header, cookie, CORS or auth regression fails your PR. No security team, no DAST, no new runner.

What a failure looks like

Error: expect(received).toHaveSecureHeaders(expected)

  [CRITICAL] content-security-policy: Content-Security-Policy header is missing
           Fix: Set a Content-Security-Policy header. Start with: default-src 'self'; script-src 'self'

  [HIGH] x-content-type-options: X-Content-Type-Options header is missing
           Fix: Set X-Content-Type-Options: nosniff

  [MEDIUM] referrer-policy: Referrer-Policy header is missing
           Fix: Set Referrer-Policy: strict-origin-when-cross-origin
  ...

Critical and high findings fail the test; medium and below are reported. Every finding names the header or cookie and the fix.

Quickstart (60 seconds)

npm install -D @orlalabs/kovar @playwright/test
npx playwright install chromium

Kovar's examples use relative URLs, so give Playwright a baseURL (and usually a webServer that starts your app):

// playwright.config.ts
import { defineConfig } from "@playwright/test";

export default defineConfig({
  use: { baseURL: "http://localhost:3000" },
  webServer: { command: "npm run dev", url: "http://localhost:3000", reuseExistingServer: true },
});

Replace your Playwright import with Kovar; everything else stays the same:

import { test, expect } from "@orlalabs/kovar"; // was: "@playwright/test"

test("login page has secure headers", async ({ page }) => {
  const response = await page.goto("/login");
  await expect(response!).toHaveSecureHeaders();
});
npx playwright test

Expect the first run to be red. On plain http://localhost, add { skip: ["strict-transport-security"] } (HSTS only applies over HTTPS). To adopt Kovar on an app with known gaps, start with { only: [...] } for the headers you already set, then fix the rest in severity order. See the Quick Start.

Add it to CI

Kovar tests are Playwright tests. npx playwright test in your existing workflow fails the PR on a regression; add the Reporter for a score card in the log.

For a URL-only header and cookie scan with SARIF output, a baseline and a PR comment, use the GitHub Action (Orla-Labs/kovar/.github/actions/[email protected]) with Baseline Tracking.

Checks

| Check | Matcher | Fails the test on | What it sends | |---|---|---|---| | Headers | expect(response).toHaveSecureHeaders() | Missing or weak CSP, HSTS, XFO / frame-ancestors, nosniff (12 headers) | Nothing; reads the response | | Cookies | expect(context).toHaveSecureCookies() | Session cookies without Secure / HttpOnly / SameSite, bad __Host- / __Secure- prefixes | Nothing; reads the browser's cookies | | Reflected XSS | expect(page).toBeResilientToXSS() | Detects server-side reflected XSS in HTML forms; not DOM/SPA, stored, or filter-bypass XSS. | Submits payloads to each form's action | | CSRF | expect(request).toBeCSRFProtected(url) | A state-changing endpoint that accepts a cross-site, tokenless request. Needs a logged-in context | Real POST/PUT/DELETE/PATCH plus a control GET | | CORS | expect(request).toHaveSecureCORS(url) | Reflected or bypassable origins with credentials, wildcard misconfiguration | OPTIONS and GET with attacker Origins | | Auth | expect(request).toRequireAuthentication(url) | An endpoint that returns 2xx without credentials | Real GET/POST/PUT/DELETE from an isolated, credential-free context |

A check that could not run (unreachable host, no form found, not logged in, page closed) fails with a high finding such as csrf-check-unauthenticated or xss-no-forms; it never passes silently. Every check is also available through the security fixture, security.audit() and the standalone API.

Fixing findings

Remediation generates framework-specific fixes for Express, Fastify, Next.js, Koa and Hono (generateRemediation, detectFramework from @orlalabs/kovar/core).

Limitations

Kovar is a regression test, not a scanner. Read What Kovar does not catch before you rely on it.

Also in this package (deprecated, removed in 0.8)

Documentation

Full documentation is available at kovar.orlalabs.com.

License

Apache 2.0