Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/metapointtech/metapoint
- Owner: MetaPointTech
- License: apache-2.0
- Created: 2023-01-25T13:00:28.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-12-05T16:41:02.000Z (about 1 year ago)
- Last Synced: 2024-11-15T03:08:49.368Z (2 months ago)
- Topics: api, channels, libp2p, rpc, subscribe, typescript, zod
- Language: TypeScript
- Homepage: https://MetaPointTech.github.io/metapoint/
- Size: 785 KB
- Stars: 12
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
MetaPoint
Meta first and low-code.
Peer-to-Peer typesafe APIs or Channels made easy.
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]
```