WebSocket Close Codes
JSON →A TypeScript library providing a strongly-typed enum for WebSocket connection close codes as defined in RFC 6455. Version 1.0.0 is the current stable release. It offers a single enum (CloseCode) with all standard close codes (NORMAL_CLOSURE, GOING_AWAY, PROTOCOL_ERROR, etc.) and maps them to their numeric values. Unlike plain string or number constants, this library provides compile-time type checking and autocomplete in IDEs, reducing errors from mistyped magic numbers. Suitable for both Node.js and browser environments with ESM and CommonJS support. No dependencies. Ships TypeScript declaration files.
Resources
packagewebsocket-close-codes ↗
API endpoints
full doc /v1/registry/websocket-close-codes