{"id":49524,"library":"tl-ngrpc","title":"tl-ngrpc","description":"tl-ngrpc is a minimal Node.js gRPC helper library that simplifies gRPC server and client setup. Version 1.0.1 wraps the grpc package to provide an event-driven server pattern and a promise-based client, supporting both HTTP and socket services. It focuses on protocol conventions rather than business logic, allowing developers to define protobuf services and attach handlers easily. The library is designed for rapid prototyping and small to medium gRPC services, offering a simpler API than grpc-js or @grpc/proto-loader. Release cadence: single stable release.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/tl-open-source/tl-ngrpc","tags":["javascript","none"],"install":[{"cmd":"npm install tl-ngrpc","lang":"bash","label":"npm"},{"cmd":"yarn add tl-ngrpc","lang":"bash","label":"yarn"},{"cmd":"pnpm add tl-ngrpc","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core gRPC functionality for Node.js","package":"grpc","optional":false},{"reason":"Loading .proto files","package":"@grpc/proto-loader","optional":false}],"imports":[{"note":"This library uses CommonJS; ESM imports may not work without a bundler.","wrong":"import { TlApiRpcServer } from 'tl-ngrpc'","symbol":"TlApiRpcServer","correct":"const TlApiRpcServer = require('tl-ngrpc/server/TlApiRpcServer');"},{"note":"Default export is not available; use named require.","wrong":"import TlApiRpcClient from 'tl-ngrpc'","symbol":"TlApiRpcClient","correct":"const TlApiRpcClient = require('tl-ngrpc/client/api/TlApiRpcClient');"},{"note":"The protoPath must be absolute, not relative; use path.resolve().","wrong":"const client = new TlApiRpcClient({ protoPath: 'teacher.proto' });","symbol":"gRPC types (proto)","correct":"const teacherApiRpcClient = new TlApiRpcClient({...});"}],"quickstart":{"code":"const TlApiRpcServer = require('tl-ngrpc/server/TlApiRpcServer');\nconst TlApiRpcClient = require('tl-ngrpc/client/api/TlApiRpcClient');\nconst path = require('path');\n\n// Server setup\nconst server = new TlApiRpcServer({\n  protoPath: path.resolve(__dirname, './teacher.proto'),\n  protoName: 'teacher',\n  protoPackage: 'api',\n  protoImpl: 'Teacher',\n  ip: '127.0.0.1',\n  port: 50051\n});\n\nserver.on('hello', (call, callback) => {\n  callback(null, { message: 'Hello ' + call.request.message });\n});\nserver.start();\n\n// Client setup (run separately)\nconst client = new TlApiRpcClient({\n  protoPath: path.resolve(__dirname, './teacher.proto'),\n  protoName: 'teacher',\n  protoPackage: 'api',\n  protoImpl: 'Teacher',\n  ip: '127.0.0.1',\n  port: 50051\n});\n\nclient.emit('hello', { message: 'world' }).then(res => {\n  console.log(res.message); // 'Hello world'\n});","lang":"javascript","description":"Demonstrates how to create a TlApiRpcServer with event handlers and a TlApiRpcClient to make gRPC calls using the library's event-based API."},"warnings":[{"fix":"Use path.resolve(__dirname, 'relative/proto/file.proto') to get absolute path.","message":"protoPath must be an absolute path. Relative paths will cause file not found errors.","severity":"gotcha","affected_versions":"1.0.1"},{"fix":"Ensure you have Python, make, and a C++ compiler installed. Alternatively, use grpc-tools or prebuilt binaries.","message":"Installation requires compiling native gRPC module, which may fail on some systems without build tools.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider migrating to @grpc/grpc-js for pure-JS, cross-platform compatibility.","message":"The library uses an older 'grpc' package, not the modern '@grpc/grpc-js'. This may cause compatibility issues in newer Node.js versions (<14).","severity":"gotcha","affected_versions":"1.0.1"}],"env_vars":null,"search_vec":"'1.0.1':22 'allow':56 'api':82 'attach':63 'base':39 'busi':54 'cadenc':90 'client':19,40 'convent':51 'defin':59 'design':69 'develop':57 'driven':32 'easili':65 'event':31 'event-driven':30 'focus':48 'grpc':11,16,25,77,85 'grpc-js':84 'grpc/proto-loader':88 'handler':64 'helper':12 'http':43 'javascript':94 'js':86 'librari':13,67 'logic':55 'medium':76 'minim':9 'ngrpc':3,6 'node.js':10 'none':95 'offer':79 'packag':26 'pattern':34 'promis':38 'promise-bas':37 'protobuf':60 'protocol':50 'prototyp':72 'provid':28 'rapid':71 'rather':52 'releas':89,93 'server':17,33 'servic':46,61,78 'setup':20 'simpler':81 'simplifi':15 'singl':91 'small':74 'socket':45 'stabl':92 'support':41 'tl':2,5 'tl-ngrpc':1,4 'version':21 'wrap':23","created_at":"2026-06-07T17:02:12.500403+00:00","updated_at":"2026-06-07T17:02:12.500403+00:00","problems":[{"fix":"Use path.resolve(__dirname, './teacher.proto') instead of just './teacher.proto'.","cause":"protoPath is relative; the library expects an absolute path.","error":"Error: ENOENT: no such file or directory, open 'teacher.proto'"},{"fix":"Install from GitHub: npm install git+https://github.com/tl-open-source/tl-ngrpc.git","cause":"Importing package incorrectly; this library is not on npm registry under that exact name.","error":"Error: Cannot find module 'tl-ngrpc'"},{"fix":"Consider using '@grpc/grpc-js' and a different helper library, or accept the deprecation warning.","cause":"Using the deprecated 'grpc' package. tl-ngrpc depends on it.","error":"Error: The 'grpc' package is no longer maintained. Please use '@grpc/grpc-js' instead."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/tl-open-source/tl-ngrpc#readme","github":"https://github.com/tl-open-source/tl-ngrpc","docs":null,"changelog":null,"pypi":null,"npm":"tl-ngrpc","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}