[nodejs] Organizing Socket IO code

2013-06-30 Thread Mike Chen
Hi guys, I'm pretty new to Node.JS and socket IO, so I was wondering if I could get some guidance on project I'm working on. I would like to build a single page multiplayer game that basically communicates solely through socket.IO. However, I am quickly seeing that my socket.js file is getting

Re: [nodejs] Organizing Socket IO code

2013-06-30 Thread Duncan Wilkie
Pass the socket.io variable around as a parameter to other files / components var io = socket.io require('./component1.js')(io) ... // component1.js  module.exports = function (io) { // logic }  — Sent from Mailbox for iPhone On Sun, Jun 30, 2013 at 10:40 AM, Mike Chen wrote: > Hi guys, >

Re: [nodejs] Organizing Socket IO code

2013-06-30 Thread Antoine van Wel
Create separate "service" modules which are completely unaware of socket.io, which accept hooks/callbacks; then in your socket.js wire them together. For example for your chat, create a module which does the room creation / chatting / joining etc and let it do callbacks whenever a room is created

Re: [nodejs] Embedded pure javascript database that aims to be close compatible to MongoDB

2013-06-30 Thread Alan Gutierrez
On Fri, Jun 28, 2013 at 07:01:15AM -0700, Сергей Коротков wrote: > Hi guys, > > For those who might be interested, we develop pure JavaScript solution that > aims to mimic API and features of MongoDB and its node.js driver: > > http://www.tingodb.com, https://github.com/sergeyksv/tingodb > > As

[nodejs] Request for comments: Impress application server

2013-06-30 Thread Timur Shemsedinov
Hello, I am looking for your comments and opinions about Impress, it is multipurpose application server and web framework with multiple hosts and ports, routing, db access, clustering, proxying, compressing, memory caching, templating and much more. The main difference from others that Impress

[nodejs] Re: i can not download packages using npm and shell

2013-06-30 Thread Yogesh Choudhary
Everything is right, its just that you are on Windows. */usr/local/lib/node_modules : *this is folder path in Unix based operating systems. and to install *sax *globally you need to run *cmd* as administrator, then type: *npm install -g sax* ** -- -- Job Board: http://jobs.nodejs.org/ Postin

[nodejs] running command-line code on setInterval

2013-06-30 Thread Jerome Covington
Hi, someone, maybe a lot of someones, are going to think this is ridiculously basic. But. I would like to write a node script that executes a command-line (bash command-line) single line of code on a setInterval. I thought it would be cool to write this in a JavaScript file that I could execute on

Re: [nodejs] Organizing Socket IO code

2013-06-30 Thread Eric Mill
Antoine's solution is the right direction. Keep all of your "routes" (endpoints) in one file, and interact with the various modules from there. This will keep your code much more flexible without adding much complexity, and will leave you more free to experiment with things, and even swap out socke

[nodejs] windows-eventlog-reader - 1.0.0

2013-06-30 Thread Stephen Vickers
Hi All, I'm pleased to announce version 1.0.0 of the windows-eventlog-reader module. This module can be used to perform non-blocking reads of the windows event log, and to tail event logs for new events. If it is not useful for anyone, it might at least be a useful reference of using the uv_q

[nodejs] Re: windows-eventlog-reader - 1.0.0

2013-06-30 Thread Stephen Vickers
Oh yes, forgot to add... Windows Event Log Syslog forwarder here I come... On Sunday, 30 June 2013 22:44:49 UTC+1, Stephen Vickers wrote: > > Hi All, > > I'm pleased to announce version 1.0.0 of the windows-eventlog-reader > module. > > This module can be used to perform non-blocking reads of th

[nodejs] Re: running command-line code on setInterval

2013-06-30 Thread Timur Shemsedinov
var exec = require('child_process').exec; setInterval(function() { exec('ls -l', function (error, stdout, stderr) { console.log(stdout); }); }, 3000); On Sunday, June 30, 2013 11:23:06 PM UTC+3, jerome wrote: > > Hi, someone, maybe a lot of someones, are going to think this is >