nodeway-helloworld
v2.0.0
Published
nodeway-component helloworld
Downloads
26
Readme
nodeway-helloworld
class HelloWorld extends Nodeway {
on(eventName, fn) { ... } // Nodeway中定义
emit(eventName, ...args) { ... } // Nodeway中定义
static get onlineUsers() { ... } // Nodeway中定义
static get onlineCount() { ... } // Nodeway中定义
broadcast(eventName, ...args) { ... } // Nodeway中定义
async say(message) { ... }
}
module.exports = HelloWorld;on()
var api = new HelloWorld;
api.on('data', console.log);emit()
api.emit('data', 'Hello World!');static get onlineUsers()
let onlineUsers = HelloWorld.onlineUsers;static get onlineCount()
let onlineCount = HelloWorld.onlineCount;broadcast()
api.broadcast('data', 'Hello World!');say()
try {
let message = await api.say('Hello Nodejs!');
console.log(message);
}
catch(e) {}License
MIT © May xiaoya zhang
