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

@proconnect-gouv/proconnect.testing

v1.0.2

Published

Mock server and CLI tools for testing ProConnect integrations with external APIs.

Readme

@proconnect-gouv/proconnect.testing

Mock server and CLI tools for testing ProConnect integrations with external APIs.

What

This package provides:

  • Mock API Server: HTTP server that mimics external service responses
  • CLI Tools: Commands for fetching and managing test data from real APIs
  • Test Data: Pre-populated JSON responses for common scenarios
  • Integration Tests: Test suite ensuring mock endpoints work correctly

Why

  • Testing without external dependencies: Test ProConnect integrations without hitting real APIs during development and CI
  • Deterministic test data: Consistent mock responses for reliable and reproducible tests
  • Development environment: Local development without needing API tokens, rate limits, or network connectivity
  • Data privacy: Anonymized test data for non-public enterprise information
  • Performance: Fast local responses vs. external API calls

How

Mock Server Usage

Create a testing handler and mount it in your application:

import { createTestingHandler } from "@proconnect-gouv/proconnect.testing/api";
import { createServer } from "http";

const handler = createTestingHandler("/testing", {
  ISSUER: "oidc.franceconnect.localhost",
  log: console.log,
});

const server = createServer(handler);
server.listen(3000);
// Server running at http://localhost:3000/testing

The handler uses Hono framework and provides:

  • Structured logging with 🎭 prefix
  • Error handling and 404 responses
  • Health check endpoint at /healthz

CLI Tools

Adding Enterprise Test Data

Fetch real establishment data and save it as anonymized test data:

Specific .env

For regular use, do not follow the next exports instructions. Create a .env.development.local file with:

ENTREPRISE_API_TOKEN="your api key"
ENTREPRISE_API_URL="https://entreprise.api.gouv.fr

Comment it out by default and uncomment it when you want to extract data.

# Set up environment variables
export ENTREPRISE_API_TOKEN="your-api-token"
export ENTREPRISE_API_URL="https://entreprise.api.gouv.fr"
export ENTREPRISE_API_TRACKING_CONTEXT="testing"
export ENTREPRISE_API_TRACKING_RECIPIENT="your-siret"

# Add establishment data
npx tsx scripts/testing.ts entreprise add 49430870300052

This command:

  1. Fetches real data from the Entreprise API
  2. Anonymizes private/non-diffusible information using predefined personas
  3. Saves the result as a JSON file in src/api/routes/entreprise.api.gouv.fr/etablissements/
  4. Formats the JSON with Prettier

Available Mock Endpoints

Entreprise API (/entreprise.api.gouv.fr)

  • GET /v3/insee/sirene/etablissements/{siret} - Establishment details
  • GET /v3/infogreffe/rcs/unites_legales/{siren}/mandataires_sociaux - Company officers
  • GET /etablissements/discover - Browse all available establishments (HTML interface)
  • GET /mandataires_sociaux/discover - Browse all available company officers (HTML interface)
  • Includes 80+ pre-populated establishments and company data
  • Handles both public and anonymized private data

INSEE API (/api.insee.fr)

  • GET /entreprises/sirene/V3/etablissements/{siret} - INSEE establishment data
  • Compatible with INSEE Sirene API format

FranceConnect OIDC (/oidc.franceconnect.gouv.fr)

  • GET /.well-known/openid-configuration - OIDC discovery endpoint
  • GET /api/v2/logout - Logout page mock
  • GET /api/v2/select - Identity provider selection mock
  • Configurable issuer for testing different environments

Running Tests

# Run all tests
npm test

# Run tests in watch mode
npm run dev:test

# Build the package
npm run build

Test Data Structure

Mock data is organized as:

src/api/routes/
├── entreprise.api.gouv.fr/
│   ├── etablissements/          # Establishment JSON files by SIRET
│   │   └── discover.page.tsx    # HTML browser for establishments
│   └── mandataires_sociaux/     # Company officers by SIREN
│       └── discover.page.tsx    # HTML browser for company officers
├── api.insee.fr/
│   └── etablissements/          # INSEE format establishment data
└── oidc.franceconnect.gouv.fr/  # OIDC mock responses

Each JSON file contains real API response structure with anonymized sensitive data when needed.

Discovery Interface

The testing server provides HTML interfaces to browse available test data:

  • Establishments: Visit /entreprise.api.gouv.fr/etablissements/discover to see all available establishments with formatted company names and expandable JSON data https://identite-showcase.proconnect.gouv.fr/testing/entreprise.api.gouv.fr/etablissements/discover
  • Company Officers: Visit /entreprise.api.gouv.fr/mandataires_sociaux/discover to browse all available company officers data https://identite-showcase.proconnect.gouv.fr/testing/entreprise.api.gouv.fr/mandataires_sociaux/discover