UpgradeJS is a lightweight, low-level Node.js library designed to facilitate direct handling of HTTP upgrade requests, primarily for establishing raw WebSocket connections. It provides utilities for writing WebSocket handshake headers, framing and unmasking WebSocket data. A key limitation of this library is its explicit restriction to WebSocket payloads not exceeding 125 bytes. The package version `1.1.0` is the latest, but the project appears to be unmaintained, with its documentation largely reflecting an earlier `1.0.0` release and no visible recent development or a current active GitHub repository. This library offers a barebones approach, requiring developers to manage many WebSocket protocol details themselves, differentiating it from more feature-rich WebSocket libraries like `ws` or `Socket.IO` that handle framing, fragmentation, and other complexities automatically.
npm install upgradeVerified import paths — ran on the pinned version, not inferred.
Demonstrates a basic WebSocket server handling HTTP upgrades, receiving messages, and sending framed responses using UpgradeJS utilities.
Ensure all WebSocket message payloads are 125 bytes or less. For larger payloads, consider a different WebSocket library or implement fragmentation manually.
Evaluate alternatives like `ws` or `uWS` for actively maintained and feature-rich WebSocket implementations. Use this library only for specific, constrained legacy requirements.
Always use `const upgrade = require('upgrade')` to import the module. If using an ES Module project, consider a CommonJS wrapper or a different library.Reduce the size of the message payload to 125 bytes or less. This library does not automatically handle WebSocket message fragmentation.
Change your import statement to `const upgrade = require('upgrade');` and access functions as properties (e.g., `upgrade.someFunction`).Ensure you are using the correct CommonJS import: `const upgrade = require('upgrade');` then access methods as `upgrade.methodName(args)`.No dependency data recorded yet.