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

@responsive-privacy/astro

v0.1.1

Published

Astro integration for responsive privacy — build-time PII protection for static sites

Readme

@responsive-privacy/astro

Astro integration for Responsive Privacy — build-time PII protection for static sites. Filters content fields at build time based on a 5-level privacy taxonomy.

Install

pnpm add @responsive-privacy/core @responsive-privacy/astro

Setup

1. Configure field mappings

Create responsive-privacy.config.ts in your project root:

import { defineConfig } from '@responsive-privacy/core';

export default defineConfig({
  collections: {
    team: {
      fields: {
        name:       'ID-01',  // Full Name — visible at Level 2+
        photo:      'ID-02',  // Photo — visible at Level 2+
        role:       'ID-03',  // Job Title — visible at Level 1+
        bio:        'ID-04',  // Biography — visible at Level 3+
        email:      'CV-01',  // Email — visible at Level 4 only
        department: 'OR-01',  // Department — visible at Level 1+
      },
    },
  },
});

2. Add the integration

// astro.config.mjs
import { responsivePrivacy } from '@responsive-privacy/astro';
import privacyConfig from './responsive-privacy.config';

export default defineConfig({
  integrations: [responsivePrivacy(privacyConfig)],
});

3. Filter content in templates

---
import { getCollection } from 'astro:content';
import { filterCollection } from '@responsive-privacy/astro/helpers';
import privacyConfig from '../responsive-privacy.config';

const rawTeam = await getCollection('team');
const team = filterCollection('team', rawTeam, privacyConfig);
---

{team.map((member) => (
  <div>
    <h3>{member.data.name}</h3>
    {member.data.role && <p>{member.data.role}</p>}
    {member.data.email && <a href={`mailto:${member.data.email}`}>Email</a>}
  </div>
))}

4. Build at different levels

PRIVACY_LEVEL=4 astro build   # Full transparency (default)
PRIVACY_LEVEL=1 astro build   # Role only — names replaced
PRIVACY_LEVEL=0 astro build   # Complete anonymity

Template Helpers

Imported from @responsive-privacy/astro/helpers:

  • filterCollection(name, entries, config, level?) — filter all entries in a collection, returns entries with transformed data and _privacy metadata
  • filterEntry(name, entry, config, level?) — filter a single entry
  • shouldShow(name, fieldName, config, level?) — check if a field would be visible (for conditional rendering)
  • getPrivacyStatus(config, level?) — get current level info for display (level, name, description, isReduced)

Virtual Module

The integration also provides a virtual:responsive-privacy module with the config baked in at build time. Add to your env.d.ts:

/// <reference types="@responsive-privacy/astro/virtual" />

Then import directly without passing config:

import { PRIVACY_LEVEL, isVisible, isFieldVisible } from 'virtual:responsive-privacy';

Integration Options

responsivePrivacy({
  ...config,
  level: 2,        // Override level (instead of reading PRIVACY_LEVEL env var)
  verbose: false,   // Suppress build log output (default: true)
})

License

MIT