Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/whitestormjs/network-module
🚀💬 Network module for Whitestorm.js (alpha)
https://github.com/whitestormjs/network-module
networking node nodejs npm socket-io websocket whs
Last synced: 10 days ago
JSON representation
🚀💬 Network module for Whitestorm.js (alpha)
- Host: GitHub
- URL: https://github.com/whitestormjs/network-module
- Owner: WhitestormJS
- Created: 2019-01-14T18:17:43.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-14T19:38:25.000Z (about 6 years ago)
- Last Synced: 2025-01-12T10:48:49.301Z (13 days ago)
- Topics: networking, node, nodejs, npm, socket-io, websocket, whs
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# network-module [![NPM Version](https://img.shields.io/npm/v/physics-module-ammonext.svg?style=flat-square)](https://www.npmjs.com/package/network-module)
Networking module for Whitestorm.js [Alpha]> Go to [WhitestormJS/whitestorm.js](https://github.com/WhitestormJS/whitestorm.js)
![physics module](http://i.imgur.com/ZdMhDwb.png)
# Modules List
## `new NETWORK.Connection()`
```javascript
const app = new WHS.App({
// ...
new NETWORK.Connection({
host: 'localhost',
port: 3000,
protocol: 'http'
})
});app.start();
```## `new NETWORK.Identity()`
```javascript
const box = new WHS.Box({
geometry: {
width: 2,
height: 2,
depth: 2
},
modules: [
new NETWORK.Identity()
],
material: new THREE.MeshBasicMaterial({color: 0xff0000})
});box.addTo(app);
```## `new NETWORK.Transform()`
```javascript
const box = new WHS.Box({
geometry: {
width: 2,
height: 2,
depth: 4
},
modules: [
new NETWORK.Transform({
position: true,
rotation: true,
scale: false,
animation: true
})
],
material: new THREE.MeshBasicMaterial({color: 0xff0000})
});box.addTo(app);
```## `new NETWORK.Event()`
You can use this to allow for special events to be fired on objects. This is easy to do, and allows for great control over different objects.```javascript
const box = new WHS.Box({
geometry: {
width: 2,
height: 2,
depth: 4
},
modules: [
new NETWORK.Event({
name: 'myCustomEvent'
id: 0,
handler: (data) => {
doSomething();
};
})
],
material: new THREE.MeshBasicMaterial({color: 0xff0000})
});box.addTo(app);
```