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

bini-server

v1.0.9

Published

Production server for bini-router apps.

Downloads

142

Readme

bini-server

npm version license node

Production server for bini-router apps.
Serves your dist/ statically and handles /api/* from your src/app/api/ handlers — just like vite preview, but production-grade.


Features

  • 🗂️ Static file serving — streams dist/ with correct MIME types, ETag, and cache headers
  • 🌐 API routes — serves /api/* from your src/app/api/ handlers (Hono apps + plain functions)
  • 🔀 SPA fallback — unknown routes serve dist/index.html
  • 🌿 Auto env loading.env files detected and listed automatically at startup
  • 🏷️ ETag support304 Not Modified responses for unchanged files
  • 🛡️ CORS — enabled by default on all API responses
  • ⏱️ Timeouts — configurable body read + handler timeouts (default 30s each)
  • 🔒 Body limit — configurable request body limit (default 10MB)
  • 🔌 Port auto-increment — starts at 3000, increments if busy
  • 🪄 Graceful shutdown — handles SIGTERM + SIGINT with 10s force-exit fallback
  • ⌨️ Interactive keyboard shortcutsh for help, o to open in browser, q to quit
  • 🖥️ Cross-platform — works on Windows, macOS, and Linux

Requirements


Install

npm install bini-server

Usage

Add to your package.json:

{
  "scripts": {
    "build": "vite build",
    "start": "bini-server"
  }
}

Then:

npm run build   # build your app
npm start       # serve it in production

Terminal output:

  ß Bini.js  (production)
  ➜  Environments: .env
  ➜  Local:   http://localhost:3000/
  ➜  Network: http://192.168.1.5:3000/
  ➜  press h + enter to show help

Keyboard Shortcuts

Once the server is running, type a key and press enter:

| Key | Action | |-----|--------| | h | Show available shortcuts | | o | Open in browser | | q | Quit |


Environment Variables

.env files are detected automatically at startup and listed in the banner. All vars are available in process.env in your API handlers with no imports needed.

PORT=3000
[email protected]
SMTP_PASS=your_password

Server Configuration

These variables tune server behaviour and can be set in .env or inline:

| Variable | Default | Description | |---|---|---| | PORT | 3000 | HTTP port to listen on | | BINI_API_DIR | src/app/api | Path to API handlers directory | | BINI_DIST_DIR | dist | Path to static files directory | | BINI_BODY_TIMEOUT_SECS | 30 | Max seconds to read request body | | BINI_HANDLER_TIMEOUT_SECS | 30 | Max seconds for an API handler to respond | | BINI_BODY_SIZE_LIMIT | 10485760 | Max request body size in bytes (default 10MB) |


Important: ship your src/ folder

bini-server runs your API handlers directly from src/app/api/ — they are not compiled into dist/. When deploying, make sure your server has access to both dist/ and src/app/api/.

For VPS/pm2 this means deploying your full project directory, not just dist/. For Railway, Render, and Fly.io this happens automatically since they clone your repository.


Port

Default port is 3000. Override via .env or inline:

PORT=8080
PORT=8080 bini-server

If the port is busy, bini-server automatically increments and warns:

  ⚠  Port 3000 in use — using 3001 instead.

Deployment

VPS (Ubuntu, Debian, etc.)

npm run build
npm start

Use pm2 to keep it running:

npm install -g pm2
pm2 start "npm start" --name my-app
pm2 save
pm2 startup

Railway

Set start command to npm start. Railway injects PORT automatically.

Render

Set start command to npm start. Render injects PORT automatically.

Fly.io

# fly.toml
[processes]
  app = "npm start"

vs vite preview

| Feature | vite preview | bini-server | |---|---|---| | Serves dist/ | ✅ | ✅ | | API routes | ✅ | ✅ | | SPA fallback | ✅ | ✅ | | Auto env loading | ✅ | ✅ | | ETag / 304 support | ❌ | ✅ | | Production use | ❌ | ✅ | | Body timeout | ❌ | ✅ 30s | | Body size limit | ❌ | ✅ 10MB | | Handler timeout | ❌ | ✅ 30s | | Graceful shutdown | ❌ | ✅ | | Handler module cache | ❌ | ✅ | | Configurable dirs | ❌ | ✅ |


License

MIT © Binidu Ranasinghe