Package Installation
AfterLink is designed with strict modularity in mind. You can install the monolith package, pull individual libraries, or load browser wrappers to fit your production stack footprint.
System Requirements
- Node.js: version
v20.0.0or higher (LTS recommended) - npm: version
v9.0.0or higher - Operating System: Linux, macOS, or Windows (WSL recommended)
1. Distribution Channels
AfterLink packages are published to two separate registries. Choose the channel that best suits your deployment environment.
Registry 1: npm (Standard / Recommended)
The standard release packages are published on the public npm registry under the official @afterlink/* scope. You can install all key modules in one command using your preferred package manager:
Registry 2: GitHub Packages (Alternative)
As an alternative distribution channel, packages are also published to GitHub Packages under the @ajaymyth/* scope. To fetch packages from GitHub, route the @ajaymyth scope in your local .npmrc configuration file:
After setting up your .npmrc file with your GitHub Personal Access Token (PAT), install the scoped package directly:
Note: Starting in v1.2.4, the umbrella afterlink package is optimized for speed and production safety. It has 0 security vulnerabilities and a very small dependency footprint. It installs core, server, client, browser, and CLI tools. The optional terminal AI assistant (@afterlink/ai-assistant) is kept separate. If you want the offline AI assistant, install it explicitly.
2. Modular Distribution Packages
If you are building lightweight microservices or embedded nodes and want to optimize package bundle size, you can import only the specific packages you need:
| Package Name | Purpose | Context |
|---|---|---|
| @afterlink/core / @ajaymyth/core | Binary frame codec (encoder, decoder, segment layouts) | Any / Universal |
| @afterlink/server / @ajaymyth/server | High-throughput TCP server runtime module | Node.js Server |
| @afterlink/client / @ajaymyth/client | Persistent TCP client wrapper with auto-reconnect | Node.js Client |
| @afterlink/browser / @ajaymyth/browser | WebSocket fallback SDK with binary streaming support | Web Browser |
| @afterlink/cli / @ajaymyth/cli | Command-line debuggers, packet tracers, and validators | Global / CLI |
| @afterlink/ai-assistant | Offline RAG AI assistant — answers AfterLink questions in your terminal | Global / CLI |
Install selected modular distributions as follows:
3. Quick Start — Server
Create a server script in your project root to handle binary framing:
4. Quick Start — Client
Establish a persistent connection from your client and publish your first frame:
5. Command-Line Developer Tools
AfterLink includes a command-line interface (CLI) to trace active frame streams, inspect live connection channels, and generate mock frame sequences during development:
Verify the command line tool installation by checking its version:
The AfterLink CLI ships with these powerful built-in utility commands:
afterlink ping <host:port>: Sends persistent ping packets to calculate heartbeat latencies.afterlink call <host:port> <route> [payload]: Invokes direct RPC endpoints and reports matching reply values.afterlink inspect <hex-string>: Decodes raw wire hex buffers into readable, formatted JSON blocks.afterlink monitor <host:port> <channel>: Listens to real-time pub/sub streams and prints routing traces.
6. Browser CDN Fallback Setup
If you are building simple frontend HTML interfaces without module bundlers, load the browser client fallback directly via CDN providers:
7. Browser Compatibility & Bundling Fixes
To guarantee compatibility across Node.js and client-side web environments, the core package (@afterlink/core / @ajaymyth/core) has been upgraded with a native "browser" mapping configuration inside its package.json.
When bundling for the browser (such as in @afterlink/browser), modern bundlers like esbuild, webpack, or Vite will automatically detect this mapping. They will dynamically ignore and stub out Node-specific modules ('net', 'tls', and 'zlib') and disable Node-specific client files (like TcpClient). This ensures the package builds and functions flawlessly in web applications without requiring complex custom configuration.
8. TypeScript Setup & Paths
If compiling with TypeScript, declare the paths inside your configuration file for proper module resolution:
9. AI Assistant (optional)
Install the offline AI assistant to ask questions directly in your terminal:
10. Upgrading an Existing Project
If you already have AfterLink installed and want to upgrade all packages to the latest versions in one go: