Registry / devops / kyoko-mesh

kyoko-mesh

JSON →
library0.4.24jsnpmunverified

kyoko-mesh is a TypeScript framework for writing gRPC microservices with minimal boilerplate. Current version 0.4.24, irregular release cadence. Automatically generates gRPC services from an exported async function object, supports async/await, nested services, and streaming via async generators. Uses a simple CLI tool (`kykm`) to run servers and make remote calls. However, the package is explicitly marked as 'Just for fun, Don’t use' and may have issues with gRPC installation over proxies. Not recommended for production.

npm install kyoko-mesh
INSTALL
IMPORT
SIG · KYOKO-MESH
K
kyoko-mesh
devopsjavascriptv0.4.24
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.

Mesh
import Mesh from 'kyoko-mesh'
const Mesh = require('kyoko-mesh').default
Mesh is the default export; in ESM, import default directly. In CJS, requires .default.
default
import API from './api'
import { default } from './api'
The API module must export a default object; named exports are not used for service definitions.
type imports
import type { Mesh } from 'kyoko-mesh'
If using TypeScript, type-only imports reduce bundle size, but Mesh is a class used at runtime.

Defines a simple gRPC service with nested methods and routes it via KyokoMesh. The server is started with the CLI, and a client calls a remote procedure.

// api.ts export default { async hello() { return 'my ' + await this.faas.server() }, faas: { async server() { return 'FAAS' }, }, } // server (terminal) // kykm serve api.ts // client.ts import Mesh from 'kyoko-mesh'; import API from './api'; const api = new Mesh().query(API); async function run() { const result = await api.hello(); console.log(result); // 'my FAAS' } run();
Debug
Known issues
gotchaPackage explicitly states 'Just for fun, Don't use.' Not intended for production environments.
fix
Do not use in production; consider alternatives like @grpc/grpc-js or nest.js microservices.
affects: all
gotchaInstalling grpc over proxy may fail due to needle issue. Requires .npmrc configuration.
fix
Add 'grpc_node_binary_host_mirror=https://npm.taobao.org/mirrors' to .npmrc or use HTTP_PROXY/HTTPS_PROXY env vars.
affects: >=0.0.0
breakingNo typed client generation; inferred API type may not match server at runtime.
fix
Manually define shared types or use a type-safe gRPC framework.
affects: all
deprecatedRelies on deprecated grpc npm package (not @grpc/grpc-js).
fix
Use @grpc/grpc-js instead, or consider this package's deprecation.
affects: all
gotchaCLI tool 'kykm' may not be globally available after npm install; requires npx or manual path.
fix
Run via npx kykm or add to package.json scripts.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'grpc'
The grpc native module is not installed or fails to compile.
fix
Ensure the environment supports native modules; consider setting grpc_node_binary_host_mirror or using --build-from-source.
TypeError: Cannot read properties of undefined (reading 'query')
Mesh is not imported correctly; using CJS require without .default.
fix
Use import Mesh from 'kyoko-mesh' (ESM) or const Mesh = require('kyoko-mesh').default (CJS).
Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules'
Global installation of kykm fails due to lack of permissions.
fix
Use npx kykm or install locally as a dev dependency and run via npm scripts.
Error: 14 UNAVAILABLE: failed to connect to all addresses
No running server on the specified address; client tries to connect before server is ready.
fix
Start the server first, ensure it's listening (check port), then run the client.
Upgrade
Version history
0.4.24latest on npm
Audit
Dependencies
grpcrequiredgRPC core library for Node.js; required for client-server communication.
Agent activity
4 hits · last 30 days
node
4
Resources
kyoko-mesh — npm install kyoko-mesh · libregistry