Socket
Book a DemoInstallSign in
Socket

echo-d

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

echo-d

Fast, simple network layer for Entity-Component Systems

latest
npmnpm
Version
0.0.1
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 03 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts