Registry / messaging / vein
library0.5.5jsnpmunverified

Vein is a lightweight RPC (Remote Procedure Call) library for Node.js and the browser that uses WebSockets for communication. The current stable version is 0.5.5, released in 2012, with no recent updates and no release cadence. It provides a simple server-client model where the server registers services (e.g., 'multiply') and clients can call them as if they were local functions. Key differentiators include built-in middleware support for authentication and authorization, and a callback-first pattern. However, Vein has been unmaintained for over a decade and relies on ES5 features, requiring an es5-shim for older browsers. It is primarily suited for hobby or legacy projects, not production use.

npm install vein
INSTALL
IMPORT
SIG · VEIN
V
vein
messagingjavascriptv0.5.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Vein
const Vein = require('vein');
import Vein from 'vein';
Vein is CommonJS only; no ES module or default export exists.
Vein.createServer
Vein.createServer(httpServer, options)
vein.createServer(httpServer)
Options object is optional but must be passed as second argument if used.
Vein.createClient
Vein.createClient(options)
new Vein.Client(options)
Vein has no Client constructor; use createClient factory.
vein.add
vein.add('serviceName', handler)
vein.add(handler)
First argument must be a string service name.

Demonstrates setting up a Vein server and client, registering a 'multiply' service, and calling it via RPC.

const http = require('http'); const Vein = require('vein'); // Server const server = http.createServer().listen(8080); const vein = Vein.createServer(server); vein.add('multiply', (res, numOne, numTwo) => { res.reply(numOne * numTwo); }); // Client const clientVein = Vein.createClient({ host: 'localhost', port: 8080 }); clientVein.on('ready', (services) => { clientVein.multiply(2, 5, (result) => { console.log('Result:', result); // 10 }); });
Debug
Known issues
deprecatedVein is unmaintained and no longer recommended for use. It has not been updated since 2012.
fix
Consider migrating to modern alternatives like Socket.IO or raw WebSocket with a custom RPC layer.
affects: <=0.5.5
gotchaVein requires ES5 features. In older browsers, you must include es5-shim to avoid runtime errors.
fix
Include es5-shim via script tag or bundler.
affects: >=0.0.0
gotchaVein.createServer expects a raw Node http.Server instance, not an Express app. Passing an Express app will fail.
fix
Create a raw http server: const server = require('http').createServer(app).listen(port);
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: Vein.createServer is not a function
Trying to use ES6 import or wrong object.
fix
Use CommonJS require: const Vein = require('vein');
ReferenceError: WebSocket is not defined
In Node.js, the 'ws' module is not installed globally.
fix
Install ws: npm install ws
Error: listen EADDRINUSE :::8080
Port 8080 is already in use.
fix
Use a different port or kill the process using port 8080.
Upgrade
Version history
0.5.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
21 hits · last 30 days
node
18
Amazon
1
OpenAI (training)
1
Resources
packagevein
vein — npm install vein · libregistry