Registry / devops / serviceware-protoc-gen-ng

serviceware-protoc-gen-ng

JSON →
library1.0.2jsnpmunverified

A protoc plugin that generates gRPC service clients and message classes for Angular applications from .proto files. Version 1.0.2 is stable; release cadence is irregular. Key differentiator: generates strongly-typed TypeScript code leveraging Angular's HttpClient and RxJS Observables, with built-in support for gRPC-Web, unlike generic protoc-gen-grpc-web which outputs plain JavaScript. The plugin requires protoc and is part of the ngx-grpc ecosystem, which includes packages for client/server communication, message serialization, and testing utilities.

npm install serviceware-protoc-gen-ng
INSTALL
IMPORT
SIG · SERVICEWARE-PROTOC
S
serviceware-protoc-gen-ng
devopsjavascriptv1.0.2
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.

GrpcCall
import { GrpcCall } from '@ngx-grpc/core'
import { GrpcCall } from '@ngx-grpc/protoc-gen-ng'
GrpcCall is exported from @ngx-grpc/core, not from the protoc plugin.
GrpcWorker
import { GrpcWorker } from '@ngx-grpc/worker'
const { GrpcWorker } = require('@ngx-grpc/worker')
Package is ESM-only, no CJS support. CommonJS require will fail.
GrpcClient
import { GrpcClient } from '@ngx-grpc/core'
import GrpcClient from '@ngx-grpc/core'
Default export is GrpcClient class; named export does not exist.
grpcTimestamp
import { grpcTimestamp } from '@ngx-grpc/core'
import { grpcTimestamp } from '@ngx-grpc/protoc-gen-ng'
Timestamp helpers are in @ngx-grpc/core, not generated.
GrpcHandler
import { GrpcHandler } from '@ngx-grpc/core'
import { GrpcHandler } from 'serviceware-protoc-gen-ng'
The npm package name is @ngx-grpc/protoc-gen-ng, not serviceware-protoc-gen-ng (that's the GitHub repo name).

Shows basic usage: generate gRPC client with protoc, import and use in Angular service.

// 1. Generate service classes from your .proto file using protoc // protoc --plugin=protoc-gen-ng --ng_out=. your-service.proto // 2. Use the generated client in an Angular service import { Injectable } from '@angular/core'; import { GrpcCall } from '@ngx-grpc/core'; import { YourServiceClient } from './generated/your-service.pbsc'; @Injectable({ providedIn: 'root' }) export class YourApiService { constructor(private grpcClient: YourServiceClient) {} getData() { return this.grpcClient.getData(new SomeRequest()); } }
Debug
Known issues
deprecatedThe @ngx-grpc/protoc-gen-ng package is deprecated in favor of @ngx-grpc/protoc-gen-ngx
fix
Use @ngx-grpc/protoc-gen-ngx instead.
affects: >=1.0.0
gotchaGenerated code requires Angular HttpClient and RxJS - ensure these are installed
fix
Add dependencies: @angular/common, @angular/core, rxjs.
affects: >=1.0.0
breakingFrom version 0.9.x to 1.0, the generator output changed from CommonJS to ESM-only; existing imports may break
fix
Switch to ESM imports and ensure your Angular project is set for ESM.
affects: >=1.0.0
gotchaThe generator does not support streaming methods (server-streaming, client-streaming, bidirectional streaming) - only unary calls
fix
Use a different gRPC client library for streaming, or wait for later versions.
affects: >=1.0.0 <1.1.0
deprecatedPackage name 'serviceware-protoc-gen-ng' is legacy; use '@ngx-grpc/protoc-gen-ng' for npm
fix
Install with npm i @ngx-grpc/protoc-gen-ng instead.
affects: >=0.9.0
Errors
Common errors & fixes
Error: Cannot find module '@ngx-grpc/core'
Missing runtime dependency @ngx-grpc/core
fix
npm install @ngx-grpc/core
Error: Could not resolve './generated/your-service.pbsc'
Generated files not in correct path
fix
Ensure protoc output directory matches the import path.
Error: Unexpected value 'GrpcClient' imported by the module...
GrpcClient not imported correctly
fix
Add GrpcClient to NgModule imports array.
Error: Type 'GrpcCall' is not generic.
Using wrong import for GrpcCall
fix
Import GrpcCall from '@ngx-grpc/core', not from the generated package.
Module parse failed: The keyword 'import' is reserved (1:0)
Webpack not configured for ESM
fix
Set target: 'es2015' or later, or add 'esm' to library type.
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
protobufjsoptionalruntime dependency for generated message classes
Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
serviceware-protoc-gen-ng — npm install serviceware-protoc-gen-ng · libregistry