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

cordon-runtime

v1.0.1

Published

Sophisticated runtime permission management for Node.js 24+.

Readme

cordon-runtime

Runtime permission management for Node.js 24+.

cordon-runtime is a developer-friendly orchestrator for the native Node.js Permission Model. It replaces complex CLI flag strings with a declarative cordon.config.json and a type-safe API, allowing you to lock down exactly what your application and its dependencies are allowed to touch.

NPM Version License: MIT TypeScript


Why cordon-runtime?

Node.js 24+ ships a native Permission Model, but managing it manually means maintaining long, fragile CLI strings. cordon-runtime brings order to that.

  • Declarative security: Define permissions in cordon.config.json instead of inline bash flags.
  • Supply chain defense: Prevent malicious npm packages from reading your .env or calling unknown servers.
  • Graceful degradation: Use Cordon.shield to handle denials with a typed fallback instead of a process crash.
  • Zero dependencies: Built entirely on native Node.js APIs.

Installation

npm install cordon-runtime

Usage

1. Create cordon.config.json

Define exactly what your application is allowed to access.

{
  "permissions": {
    "fs": {
      "read": ["./dist"],
      "write": ["./logs"]
    },
    "net": ["api.stripe.com", "localhost:5432"]
  }
}

Note: node_modules, the Node.js executable directory, and the entry script itself are always allowed automatically — you do not need to list them.

2. Build your app

The CLI runs compiled JavaScript. Build your project before running with cordon.

npm run build

3. Run with the CLI

npx cordon run dist/index.js

cordon reads cordon.config.json, translates it into the appropriate --permission flags, and spawns your app in an isolated process.


Programmatic API

Cordon.shield(scope, reference, action, fallback)

Executes action if the permission is granted, otherwise returns fallback without throwing.

import { Cordon } from 'cordon-runtime';

const config = await Cordon.shield(
  'fs.read',
  './config/database.json',
  () => readConfig(),
  { host: 'localhost', port: 5432 }
);

Cordon.has(scope, reference)

Returns true if the process has the requested permission.

if (Cordon.has('net', 'api.stripe.com')) {
  // safe to make the request
}

Valid scopes: 'fs.read' | 'fs.write' | 'net' | 'worker'

When the permission model is not active (e.g. local development without the --permission flag), both methods default to allowing all operations.


Configuration reference

{
  "permissions": {
    "fs": {
      "read": ["./dist"],
      "write": ["./tmp"]
    },
    "net": ["api.example.com", "localhost:3000"],
    "worker": true,
    "child-process": true,
    "wasi": true,
    "inspector": true
  }
}

| Field | Type | Description | | :--- | :--- | :--- | | permissions.fs.read | string[] | Paths the process may read | | permissions.fs.write | string[] | Paths the process may write | | permissions.net | string[] | Hosts the process may connect to | | permissions.worker | boolean | Allow worker thread creation | | permissions.child-process | boolean | Allow spawn, exec, and fork | | permissions.wasi | boolean | Allow WASI system interface access | | permissions.inspector | boolean | Allow the Node.js debugger/inspector |

All fields are optional. Boolean flags default to false when omitted. Paths are resolved relative to the working directory where cordon is invoked.

Note: permissions.worker is automatically set to true when running a .ts file, since the tsx TypeScript loader requires it internally.


Comparison

| Feature | Standard Node.js | cordon-runtime | | :--- | :--- | :--- | | Configuration | Manual --permission CLI flags | cordon.config.json | | Developer experience | Hard to maintain | Version-controlled and readable | | Permission denials | Process crash | Graceful fallback via Cordon.shield | | Dependency isolation | Manual, easy to forget | Automatic on every run |


Requirements

  • Node.js v24 or higher (uses the stable --permission flag introduced in v24).

License

MIT © 2026