@effect/platform for different JavaScript runtimes. These packages allow you to write platform-independent code while seamlessly integrating with runtime-specific features.
Available Platforms
Effect provides three platform-specific packages:Node.js
The@effect/platform-node package provides implementations for Node.js environments, including:
- HTTP servers and clients
- File system operations
- Process spawning
- WebSocket support
- Redis integration
- Worker threads
Browser
The@effect/platform-browser package provides implementations for browser environments, including:
- HTTP client using Fetch API
- Local storage via KeyValueStore
- WebSocket connections
- Web Workers
- Browser-specific APIs (Clipboard, Geolocation, Permissions)
Bun
The@effect/platform-bun package provides implementations optimized for the Bun runtime, including:
- High-performance HTTP servers
- File system operations using Bun APIs
- WebSocket support
- Process spawning
- Redis integration
Platform-Agnostic Code
The key benefit of the platform packages is that you can write code using@effect/platform abstractions and swap implementations based on your target runtime: