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

worktree-portless

v0.1.0

Published

Deterministic port allocation and portless subdomain isolation for git worktrees

Downloads

97

Readme

worktree-portless

Deterministic port allocation and portless subdomain isolation for git worktrees.

When working with multiple git worktrees, each instance needs unique ports to avoid conflicts, and unique subdomains to prevent cookie collisions. wtp solves both problems by hashing the worktree name into deterministic port assignments and wrapping commands with portless for subdomain routing.

Install

pnpm install -g worktree-portless

This also installs portless globally if not already present.

Usage

# Command first, flags after
wtp pnpm nx run banana-server:serve --portless --port PORT:5000-5999 WDS_PORT:3000-3999

# With a configuration from config
wtp --config server

# Configuration with command override
wtp pnpm nx run banana-server:serve:e2e --config server

# Simple command
wtp make serve --port PORT:5000-5999

Flags

| Flag | Description | Default | |------|-------------|---------| | --portless | Wrap command with portless for subdomain routing | false | | --portless-port <port> | Portless proxy port | 1355 | | --port <entries...> | Port range env vars: PORT:3000-3999 | — | | --origin <keys...> | Origin env vars: CYPRESS_BASE_URL | — | | --env <entries...> | Static env vars: NODE_ENV:test FOO:bar | — | | --config <name> | Load configuration from config file | — |

Config file

Create worktreeportless.config.js (or .ts, .json, .yaml) in your project root:

export default {
  configurations: {
    server: {
      command: 'pnpm nx run banana-server:serve',
      portless: true,
      computedEnv: [
        { type: 'port', key: 'PORT', min: 5000, max: 5999 },
        { type: 'port', key: 'WDS_PORT', min: 3000, max: 3999 },
      ],
    },
    tests: {
      command: 'pnpm nx run banana-acceptance-tests:e2e',
      computedEnv: [
        { type: 'port', key: 'PORT', min: 5000, max: 5999 },
        { type: 'origin', key: 'CYPRESS_BASE_URL' },
      ],
    },
  },
};

CLI flags override configuration values when both are provided.

How it works

  1. Detects the repo name (from git remote get-url origin) and worktree name (from git rev-parse --show-toplevel)
  2. Hashes repoName/worktreeName with SHA-256 to deterministically assign ports within configured ranges
  3. Optionally wraps the command with portless for subdomain-based routing (http://worktree.localhost:port)
  4. Spawns the command with resolved environment variables

License

MIT