Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/metapointtech/metapoint

⚡Meta first and low-code. Peer-to-Peer typesafe APIs or Channels made easy.
https://github.com/metapointtech/metapoint

api channels libp2p rpc subscribe typescript zod

Last synced: 2 months ago
JSON representation

⚡Meta first and low-code. Peer-to-Peer typesafe APIs or Channels made easy.

Awesome Lists containing this project

README

        





metapoint



MetaPoint


Meta first and low-code.
Peer-to-Peer typesafe APIs or Channels made easy.



Apache-2.0 License


Discord


Version


Downloads


Total Downloads




Demo


MetaPoint lets you focus on what you want to do




## Intro

More information at https://metapointtech.github.io/metapoint/

## Quickstart

```typescript
import { h, MetaType, peer, z } from "metapoint";

// router group
const g = h();

// node1(nodejs/browser)
const node1 = await peer({
endpoint: {
numberAdd: g.handler({
func: async ({ data, send, done }) => {
await send(data + 1);
await done();
},
input: z.number(),
output: z.number(),
}),
},
});
export type meta = MetaType;

// node2(nodejs/browser)
const node2 = await peer();
const channel = await node2.connect(node1.meta().addrs);
const add = await channel("numberAdd");
console.log(await add(1)); // [2]
```