Registry / devops / groa
library0.0.15jsnpmunverified

Express gRPC middleware framework for Node.js that provides a Koa 2-style middleware system and API. Current stable version is 0.0.15. It supports async/await based middleware, bidirectional streaming, and a built-in status code system. Key differentiators include familiar Koa-like context and middleware pattern, built-in proto loading, and streaming support. Release cadence is irregular. Requires Node.js v7.6+.

npm install groa
INSTALL
IMPORT
SIG · GROA
G
groa
devopsjavascriptv0.0.15
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.

Groa
const Groa = require('groa')
import Groa from 'groa'
Groa uses CommonJS; there is no default ESM export.
status constants
ctx.status = Groa.status.ABORTED
ctx.status = 10
Use the Groa.status enum for readability.
middleware
app.use(async (ctx, next) => { ... })
app.use(function(ctx, next) { ... })
Middleware must be async functions; plain functions will not work.

Sets up a Groa gRPC server that echoes the request body back.

const Groa = require('groa'); const app = new Groa(); app.addProto(__dirname + '/example.proto'); app.use(async (ctx, next) => { ctx.body = ctx.req.body; }); app.listen(50051, () => { console.log('Listening on port 50051'); });
Debug
Known issues
gotchaGroa is not compatible with plain callback functions; middleware must be async/await.
fix
Use async functions for middleware.
affects: >=0.0.1
gotchaThe 'addProto' method expects an absolute path or relative path from cwd; relative paths may fail if not run from project root.
fix
Use __dirname + '/relative/path' or path.resolve().
affects: >=0.0.1
gotchaStreaming methods: ctx.body.write() must be called only after the stream is open; early writes may be lost.
fix
Ensure stream is open before writing.
affects: >=0.0.1
Errors
Common errors & fixes
TypeError: Cannot read property 'body' of undefined
Middleware not waiting for next() or not returning a promise.
fix
Ensure middleware is async and calls await next() if needed.
Error: Cannot find module 'groa'
Package not installed.
fix
Run 'npm install groa --save'.
Upgrade
Version history
0.0.15latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
12
Resources
packagegroa
groa — npm install groa · libregistry