Skip to content

Bunson is a JSON-RPC 2.0 server implementation for Bun.

Notifications You must be signed in to change notification settings

kesompochy/bunson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bunson

Bunson is a JSON-RPC 2.0 server implementation for Bun. It provides a simple way to create JSON-RPC servers with HTTP support using Bun.

Installation

$ bun add bunson

Usage

import { JsonRpcHandler, BunsonServer } from 'bunson';

const methods = {
  add: (params: { a: number, b: number }) => params.a + params.b,
  subtract: (params: { a: number, b: number }) => params.a - params.b,
};

const handler = new JsonRpcHandler({ methods });

const server = new BunsonServer(handler);
server.listen(3000);

About

Bunson is a JSON-RPC 2.0 server implementation for Bun.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published