@volankey/grpc-web-pb-transform
v1.0.1
Published
GRPC WEB from object transform
Downloads
1
Maintainers
Readme
value-type-transfer
cjs2esm.js
For vite, because xxx_pb.js
is commonjs generated by protoc.
grpc-web-client-transform.js
It is executed after cjs2esm.js.
Replace import * as xxx_pb from './xxx_pb'
to import xxx_pb from './xxx_pb'
index.js
transfer xxx_pb.js
for invoker to get setWrapperFields
's value type.
Usage
const {
pbValueTypeTransfer,
cjs2esm,
grpcWebClientTransform,
} = require('value-type-transfer');
pbValueTypeTransfer(join(__dirname, '../src/proto/echo_pb.js'));
// if you use vite, transform to esm
cjs2esm(join(__dirname, '../src/proto/echo_pb.js'));
grpcWebClientTransform(join(__dirname, '../src/proto/EchoServiceClientPb.ts'));