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

@bridgerb/port-from-name

v1.0.1

Published

Deterministic Vite/SvelteKit dev-server port derived from your project name

Readme

@bridgerb/port-from-name

Give every project its own dev-server port, automatically. The port comes from your project's name, so it's the same every time you run it — no more "port 5173 is already in use" when you've got a couple of apps going at once.

Install

npm install -D @bridgerb/port-from-name

Use it

Add it to vite.config.ts and you're done:

import { sveltekit } from '@sveltejs/kit/vite';
import { autoPort } from '@bridgerb/port-from-name';
import { defineConfig } from 'vite';

export default defineConfig({
  plugins: [sveltekit(), autoPort()],
});

It picks a stable port for both npm run dev and npm run preview. If two apps ever happen to pick the same one, Vite just bumps to the next free port instead of crashing.

What ports it uses

By default it picks from 3100–4899. That range is chosen to stay out of the way:

  • Above the low ports your OS reserves (anything under 1024).
  • Past the usual suspects everything else grabs — 3000 (Node/Next/Rails), 5173 (Vite's default), 5432 (Postgres), and 5000/7000 (AirPlay on Mac).
  • Well below the high ports your machine hands out for its own connections, so you're never fighting it for one.

It's also wide enough that running a handful of apps at once almost never picks the same port twice. Want a different range? Set base and range (see below).

Just want the number?

import { portFromName } from '@bridgerb/port-from-name';

const port = portFromName();              // from this project's name
const port2 = portFromName({ name: 'my-app' });

Options

autoPort({
  name,        // use a custom name instead of package.json's
  base,        // lowest port to pick (default 3100)
  range,       // how wide the range is (default 1800, so 3100–4899)
  strictPort,  // crash instead of bumping on a clash (default false)
});

License

Unlicense — public domain.