Registry / devops / gaia
library3.1.7jsnpmunverified

Gaia is a Node.js framework for building gRPC services with a focus on intuitive service definition, custom error handling, and shareable .proto files packaged as npm dependencies. Current version 3.1.7 supports both proto2 and proto3, integrates with Egg.js plugins, and provides optional RESTful API routing on top of gRPC. It distinguishes itself from raw gRPC by offering opinionated structure, built-in controller orchestration, and centralized proto management. Development appears sporadic with no recent releases.

npm install gaia
INSTALL
IMPORT
SIG · GAIA
G
gaia
devopsjavascriptv3.1.7
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Server
const { Server } = require('gaia')
import { Server } from 'gaia'
CJS-only, no ESM exports
Client
const { Client } = require('gaia')
import Client from 'gaia'
Default import does not exist
resolvePackage
const { resolvePackage } = require('gaia')
Utility function for resolving proto packages

Demonstrates creating a gRPC server and client with Gaia's intuitive API, loading proto files from a root directory.

const path = require('path'); const { Server, Client } = require('gaia'); // Start server const root = path.join(__dirname, 'proto'); const server = new Server(root); server.listen(50051); // Run client (async () => { const client = new Client(root); const { Greeter } = client.connect('localhost:50051'); const { message } = await Greeter.sayHello({ name: 'world' }); console.log(message); // Hello world })();
Debug
Known issues
gotchaClient.connect() returns service objects, not a client stub
fix
Use destructuring to extract services: const { Greeter } = client.connect(host)
affects: >=3.0.0
deprecatedServer.kill() is deprecated; use Server.close()
fix
Replace server.kill() with await server.close()
affects: >=3.0.0
gotchaProto files must be part of an npm package to be importable
fix
Ensure .proto files are in a directory with package.json or use includeDirs
affects: >=3.0.0
breakingRemoved support for @grpc/proto-loader; uses internal loader
fix
Upgrade your proto definition to be compatible with Gaia's loader
affects: >=3.0.0
gotchaRequires Node.js >=10, no ESM support
fix
Use CommonJS require()
affects: >=3.0.0
Errors
Common errors & fixes
Error: Cannot find module 'gaia'
Gaia not installed or import path incorrect
fix
Run 'npm install gaia'
TypeError: Client is not a constructor
Using default import instead of named import
fix
Use const { Client } = require('gaia')
Error: ENOENT: no such file or directory, open '/path/to/proto/package.json'
Proto root directory missing package.json
fix
Create a package.json in the proto directory or use { includeDirs } config
Error: listen EADDRINUSE :::50051
Port already in use
fix
Use a different port or kill the existing process
Upgrade
Version history
3.1.7latest on npm
Audit
Dependencies
@grpc/grpc-jsrequiredCore gRPC implementation
egg-coreoptionalPlugins support
Agent activity
2 hits · last 30 days
node
2
Resources
packagegaia
gaia — npm install gaia · libregistry