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

@rahul_ur/devlink-bridge

v1.0.2

Published

Browser SDK + local bridge server for devlink — connects your web app to VSCode over a local WebSocket

Downloads

0

Readme

devlink-bridge

The WebSocket tunnel between your browser app and VSCode. Part 2 of 4 in the devlink system.

devlink-babel-plugin  ← stamps data-source at build time  
devlink-bridge        ← THIS PACKAGE: browser ↔ VSCode tunnel + cache
devlink-editor        ← Monaco editor panel
devlink-inspector     ← click-to-inspect overlay

How it works

The bridge has two parts:

  • Browser SDK (devlink-bridge) — a small class you instantiate in your app. It opens a WebSocket to localhost, manages a file cache, and exposes readFile, writeFile, watchFile methods.
  • VSCode Extension (extension/) — starts a local WebSocket server when VSCode opens. It handles file reads/writes using the real filesystem and pushes file changes to the browser whenever a watched file is saved on disk.

Files cross the bridge exactly once — after the first read they live in the browser-side cache. The extension's file watcher pushes changes automatically, so the cache stays fresh without polling.


Installation (Browser SDK)

npm install devlink-bridge
# or during development:
npm link devlink-bridge

Browser SDK usage

import { DevlinkBridge } from 'devlink-bridge';

const bridge = new DevlinkBridge({
  port: 7100,          // optional — auto-discovers if omitted
  heartbeatMs: 5000,   // ping interval
  timeoutMs: 10000,    // request timeout
  onStatusChange: (status) => console.log('Bridge:', status),
});

// Read a file (cached after first fetch)
const content = await bridge.readFile('/src/App.tsx');

// Write a file (debounce recommended — 500ms)
await bridge.writeFile('/src/App.tsx', newContent);

// Watch for changes pushed from VSCode
const unwatch = await bridge.watchFile('/src/App.tsx', (path, content) => {
  console.log('File changed on disk:', path);
});

// Read directory tree
const tree = await bridge.readDir('/src', true); // recursive

// Status
bridge.onStatusChange(status => {
  // 'connecting' | 'connected' | 'reconnecting' | 'disconnected'
});

// Debug
console.log(bridge.getCacheSnapshot());

// Cleanup
bridge.destroy();

VSCode Extension setup

The extension folder (extension/) is a standalone VSCode extension. Install it once on your machine.

Development (local install):

cd devlink-bridge/extension
npm install
npm run build

# Then in VSCode:
# Ctrl+Shift+P → "Extensions: Install from VSIX..."
# Or press F5 in VSCode to launch an Extension Development Host

What it does when active:

  • Starts a WebSocket server on 127.0.0.1 (loopback only — not exposed to network)
  • Scans ports 7100–7200, uses the first available one
  • Shows the active port in the VSCode status bar: $(radio-tower) devlink :7100
  • Watches files on request and pushes changes to all connected browsers
  • Writes files directly to disk when the browser editor saves

Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | port | number | auto | Try this port first before scanning | | portRange | [number, number] | [7100, 7200] | Range to scan for the extension | | heartbeatMs | number | 5000 | Ping interval in ms | | timeoutMs | number | 10000 | Request timeout in ms | | maxReconnectAttempts | number | Infinity | Stop trying after N failures | | reconnectBaseMs | number | 500 | Exponential backoff base | | onStatusChange | function | — | Called on every status change |


Connection status

bridge.onStatusChange(status => {
  switch (status) {
    case 'connecting':    // first connect attempt
    case 'connected':     // handshake complete, ready
    case 'reconnecting':  // lost connection, retrying with backoff
    case 'disconnected':  // gave up or destroyed
  }
});

Security

The WebSocket server binds to 127.0.0.1 only — it is never accessible from other machines on your network. It is a dev-only tool and should never run in production.


License

MIT