echo-d

0.0.1 • Public • Published

Fast, simple network layer for Entity-Component Systems

Dolphin

Echo-D (es)

Distributed Entity-Component network protocol for JavaScript

MIT License

Prerequisites

  • A JavaScript runtime is required. Echo-D has been test using:
    • Modern Browsers (Chrome, Edge, and FireFox)
    • Bun, Deno and Node.JS

Installation

Install Echo-D with npm, pnpm, or yarn

  npm install echo-d 

Basic Usage

Here is an example snippet that shows the basic usage of Echo-D:

import EchoD from 'echo-d';
import { EventEmitter } from 'node:events';

const context = {
  events: new EventEmitter()
};

const options = {
  responder(data) => {
    otherEchoD.many(data)
  },
  onUpdate() {
    context.events.emit('update')
  }
};

const echoD = new EchoD(context, options);

echoD.spawnActor('actor')
echoD.actorInput('actor', { type: 'jump' })

echoD.spawnEntity('entity')
echoD.upsertComponent('entity', 'component', 'value')

echoD.updater().then(() => console.log('update finished'))

Documentation

Please refer to the documentation for more detailed information:

Documentation

Development Guide

Echo-D (es) is developed and tested for web, bun, deno, and node.js. It is recommended to have bun, deno, and node.js installed for development.

Building web bundle

To bundle for the web, run one of the following commands:

  script/build/all.sh # build them all:
  script/build/bun.sh # build with bun
  script/build/deno.sh # build with deno/esbuild
  script/build/node.sh # build with node/webpack

Running Tests

To run tests, run one of the following commands:

  script/test/all.sh # test them all:
  script/test/web.sh # test in the web with puppeteer
  script/test/sys.sh # test the system tests:
  script/test/sys-bun.sh # test with bun
  script/test/sys-deno.sh # test with deno
  script/test/sys-node.sh # test with node

Readme

Keywords

none

Package Sidebar

Install

npm i echo-d

Weekly Downloads

1

Version

0.0.1

License

ISC

Unpacked Size

1.25 MB

Total Files

72

Last publish

Collaborators

  • rolandpoulter