@project-spearmint/interface

1.0.1 • Public • Published

Spearmint Interface

A node module to help you communicate with the spearmint router: https://github.com/cbpudding/spearmint-router.

Introduction

The Spearmint local routing protocol is a powerful tool for decentralized communication between computers on a local network. To harness the power of the protocol, this module uses interprocess communication to hook into the power of spearmint-router, which can then be used to define your own protocol.

Example

import * as Spearmint from "index.ts"

let TestProtocol: Spearmint.Protocol = new Spearmint.Protocol("Test")

TestProtocol.on("message", (message: Spearmint.IMessage) => {
	console.log(message)
	TestProtocol.unregister()
})

TestProtocol.send(
	"1974ca9c0d28befe39080a8bcccbb0d1a459b86ffd58250422612f5088f60ab3ae1a145a8604071a153680098a7f2c8a550dcf2045203b95f3008e34c5e6e695", // This is my Spearmint address
	Buffer.from("Hello there")
)

Readme

Keywords

none

Package Sidebar

Install

npm i @project-spearmint/interface

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

20.5 kB

Total Files

8

Last publish

Collaborators

  • breadpudding
  • nicksworld