A gRPC client library for the Dwarf URL shortening microservice. Version 1.0.7 provides a simple async API to shorten multiple URLs via a gRPC endpoint configured through the DWARF_GRPC_SERVER environment variable. It is designed for Node.js web servers and uses @grpc/grpc-js for gRPC connectivity. The library is minimal and focuses on batch shortening with error propagation. Compared to HTTP-based URL shorteners, it offers lower latency through gRPC streaming. Release cadence is irregular; no recent updates since 1.0.7.
npm install dwarf-clientNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates importing the shorten function and batch-shortening two URLs, logging the result.
Set DWARF_GRPC_SERVER environment variable, e.g., export DWARF_GRPC_SERVER=localhost:50051
Use import syntax or enable ESM in your project (type: module in package.json).
Wrap calls in try/catch blocks as shown in the documentation.
Ensure DWARF_GRPC_SERVER is defined and the gRPC server is running.
Use import { shorten } from 'dwarf-client' and enable esModuleInterop in tsconfig.json.Change import DwarfClient from 'dwarf-client' to import { shorten } from 'dwarf-client'.