camera.ui nats package
npm install @camera.ui/natsNATS Server binary downloader for camera.ui - downloads the official NATS Server for internal messaging and RPC communication.
``bash`
npm install @camera.ui/nats
The NATS Server binary will be automatically downloaded during installation.
`typescript
import { natsServerPath, isNatsServerAvailable } from '@camera.ui/nats';
// Get NATS Server binary path
const natsServer = natsServerPath();
console.log('NATS Server path:', natsServer);
// Check if NATS Server is available
if (isNatsServerAvailable()) {
console.log('NATS Server is ready to use');
}
`
This package downloads the official NATS Server binary used by camera.ui for:
- RPC Communication - Inter-service messaging between camera.ui components
- Event Distribution - Real-time event broadcasting
- Plugin Communication - Messaging between plugins and core
- Clustering - Multi-instance camera.ui deployments
Supported Platforms:
- Linux - x64, ARM64, ARMv6, ARMv7, x86, PowerPC64, S390X, MIPS64LE
- Windows - x64, ARM64, ARMv6, ARMv7, x86
- macOS - Intel (x64), Apple Silicon (ARM64)
- FreeBSD - x64
typescript
import { natsServerPath } from '@camera.ui/nats';
import { spawn } from 'child_process';const natsServer = spawn(natsServerPath(), [
'--config', 'nats.conf',
'--port', '4222'
]);
`$3
`typescript
import { isNatsServerAvailable, natsServerPath } from '@camera.ui/nats';if (!isNatsServerAvailable()) {
console.error('NATS Server not found');
process.exit(1);
}
console.log('Using NATS Server at:', natsServerPath());
`$3
`typescript
import { natsServerPath } from '@camera.ui/nats';// Used internally by camera.ui for RPC communication
const natsServer = spawn(natsServerPath(), [
'--config', '/path/to/camera-ui/nats.conf',
'--port', '4222',
'--cluster_name', 'camera-ui'
]);
`Cross-Platform Installation
`bash
Force specific platform/architecture
npm_config_os=linux npm_config_cpu=arm64 npm install
`Examples:
`bash
npm_config_os=linux npm_config_cpu=x64 # Linux x64
npm_config_os=linux npm_config_cpu=arm64 # Linux ARM64
npm_config_os=win32 npm_config_cpu=x64 # Windows x64
npm_config_os=darwin npm_config_cpu=arm64 # Apple Silicon
`File Format Support
The installer automatically handles different archive formats:
- TAR.GZ - Linux and macOS binaries
- ZIP - Windows binaries
- DEB - Some Linux architectures (S390X, MIPS64LE)
Installation Process
The installer automatically:
1. Detects your platform and architecture
2. Downloads the appropriate binary from NATS official releases
3. Extracts from archive (TAR.GZ, ZIP, or DEB)
4. Makes executable (Unix systems)
5. Cleans up temporary files
$3
`
Detected platform: linux / arm64
Downloading NATS Server v2.11.4...
Extracting nats-server-v2.11.4-linux-arm64.tar.gz...
Making executable...
Done!
``NATS Server provides the messaging backbone for camera.ui:
Contributions are welcome! Please read our contributing guidelines and submit pull requests to our repository.
MIT
---
Part of the camera.ui ecosystem - A comprehensive camera management solution.