[nodejs] analytic logger with node-http-proxy

2012-05-30 Thread dvbportal
We are using  node-http-proxy with Redis for that. See: 
http://blog.cloudno.de/website-statistics-using-nodejs-and-redis-40667
That part is for the collection of the metrics. Redis can do queries for 
ranking top referrals, IPs etc plus simple counts. 

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] analytic logger with node-http-proxy

2012-05-30 Thread john.tiger
is there a code snippet of a good means of logging visitor info (ie 
referral domains) if using node-http-proxy ?


--
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] NPM can't install appjs. Error: Cannot find module 'graceful-fs'

2012-05-30 Thread Martin Cooper
On Wed, May 30, 2012 at 11:19 AM, Zephlon Arphanosh
 wrote:
> I installed node.js and npm already, but when I try to install appjs I
> get this error:

That looks to me like npm hasn't been installed successfully, since
the error is coming from npm itself trying to load graceful-fs, not
from any install targets. How did you install node and npm, and what
versions do you have? Can you run any npm commands (e.g. npm -v or npm
view ini) successfully?

--
Martin Cooper


> zephlon@zephlon-T5254:~$ npm install appjs
>
> node.js:201
>    throw e; // process.nextTick error, or 'error' event on first tick
>          ^
> Error: Cannot find module 'graceful-fs'
>    at Function._resolveFilename (module.js:334:11)
>    at Function._load (module.js:279:25)
>    at Module.require (module.js:357:17)
>    at require (module.js:368:17)
>    at Object. (/usr/share/npm/lib/utils/ini.js:32:10)
>    at Module._compile (module.js:432:26)
>    at Object..js (module.js:450:10)
>    at Module.load (module.js:351:31)
>    at Function._load (module.js:310:12)
>    at Module.require (module.js:357:17)
> I get similar errors on any attempt to install graceful-fs.
>
> I am using Ubuntu 12.04 LTS.
>
> Here's the link to the appjs website: http://appjs.org/
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Katana - MVC/HMVC framework for any Node.js samurai.

2012-05-30 Thread Bernardo Rosmaninho
Shogun, I'm getting this error:

bernardo@eniac ~/Projetos $ katana create app

Create application at: /home/bernardo/Projetos/app/ ? [Yes|No]: y

Done!

bernardo@eniac ~/Projetos $ cd app/

*bernardo@eniac ~/Projetos/app $ node app*

*
*

*module.js:337*

*throw new Error("Cannot find module '" + request + "'");*

*  ^*

*Error: Cannot find module 'katana'*

*at Function._resolveFilename (module.js:337:11)*

*at Function._load (module.js:279:25)*

*at Module.require (module.js:359:17)*

*at require (module.js:375:17)*

*at Object. (/home/bernardo/Projetos/app/app.js:1:73)*

*at Module._compile (module.js:446:26)*

*at Object..js (module.js:464:10)*

*at Module.load (module.js:353:31)*

*at Function._load (module.js:311:12)*

*at Array.0 (module.js:484:10)*


Att,
Bernardo Rosmaninho




2012/5/30 Shogun 

> вторник, 29 мая 2012 г., 23:48:15 UTC+3 пользователь EllisGL написал:
>
>> Just wanted to say, so far it looks good. Was wondering if you are going
>> to do a tutorial. Something like a guest book with a DB backend, sessions /
>> cookies, and something showing integration with socket.io.
>>
>
> Hi EllisGL, for sure i will write some tutorial, soon.
>
> Thanks Bernardo. ;)
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Best practices for sharing code and data between the server and client

2012-05-30 Thread Martin Cooper
On Wed, May 30, 2012 at 4:58 AM, Amjad  wrote:
> Hello everybody!
>
> I'm new to the great world of Node.js and have been playing around with
> different modules and frameworks. However, there seems a lot of methods for
> sharing server code with the client, and there are no default way for doing
> that.

That's in part because it rather depends on what you're trying to do.
For example, you might be:

* trying to take existing code written for Node and run it in the browser
* trying to take existing code written for the browser and run it in Node
* trying to write a new codebase that will run in both places

As has been mentioned, browserify is probably the best solution for
the first of these. I think it's safe to say that it garners the most
attention, in part because it's good at what it does.

For the last case, you might want to take a look at YUI, which
provides the abstractions to let you write your code once and run it
in both places. Yahoo! has built Mojito on top of YUI and is using
that to create multi-device apps that transparently share code between
client and server. (BTW, you'll likely find that YUI is much more
lightweight and modular than you think.)

--
Martin Cooper


> I have come across many ideas:
>
> express-expose: this is a nice replacement for parsing JSON objects rendered
> by the the server.
> https://github.com/visionmedia/express-expose
>
> This article exposes a hack to share backbone models on the Node server, and
> they are trying to neat their hack with their Capsule and Thoonk frameworks:
> http://andyet.net/blog/2011/feb/15/re-using-backbonejs-models-on-the-server-with-node/
>
> Syncrhonizing Backbone model using socket.io
> https://github.com/scttnlsn/backbone.io
>
> DNode and RPC as a method to use server methods on the client and vice versa
> https://github.com/substack/dnode
>
> I know I've mixed a lot of topics, I thought sharing my confusion would help
> to get more clarification, especially that there are a lot of production
> projects based on Node, andI think that the community certainly have reached
> a good collection of concepts and tools for sharing code between the server
> and client. I would be very grateful for sharing your thoughts about that.
>
> Best regards,
>
> Amjad
>
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Need raw http headers

2012-05-30 Thread Simon
You have to patch the request prototype and hook into the _addHeaderLine. 
It's not hard, but it's a bit hacky.

var http = require('http')
  , req = http.IncomingMessage.prototype;

var _addHeaderLine = req._addHeaderLine;

//Patch ServerRequest to save unmodified copy of headers
req._addHeaderLine = function(field, value) {
  var list = this.complete ?
(this.allTrailers || (this.allTrailers = [])) :
(this.allHeaders || (this.allHeaders = []));
  list.push(field + ': ' + value);
  _addHeaderLine.call(this, field, value);
};


Then you can access the unmodified headers in req.allHeaders. To put them 
back together obviously, just do req.allHeaders.join('\r\n').

Hope this helps.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Need raw http headers

2012-05-30 Thread Simon
You have to patch the request prototype and hook into the _addHeaderLine. 
It's not hard, but it's a bit hacky.

var http = require('http')
  , req = http.IncomingMessage.prototype;

var _addHeaderLine = req._addHeaderLine;

//Patch ServerRequest to save unmodified copy of headers
req._addHeaderLine = function(field, value) {
  var list = this.complete ?
(this.allTrailers || (this.allTrailers = {})) :
(this.allHeaders || (this.allHeaders = {}));
  if (field in list) {
list[field].push(value);
  } else {
list[field] = [value];
  }
  _addHeaderLine.call(this, field, value);
};

Then you can access the unmodified headers in req.allHeaders. To put them 
back together obviously, just do req.allHeaders.join('\r\n').

Hope this helps.

On Thursday, May 31, 2012 9:07:14 AM UTC+10, CoolAJ86 wrote:
>
> I'm working on a debugging tool and want to show the actual raw http 
> headers (with original case, position, \r\n etc).
>
> Is there any way to go about that without implementing my own http server 
> with the tcp library?
>
> AJ ONeal
>

On Thursday, May 31, 2012 9:07:14 AM UTC+10, CoolAJ86 wrote:
>
> I'm working on a debugging tool and want to show the actual raw http 
> headers (with original case, position, \r\n etc).
>
> Is there any way to go about that without implementing my own http server 
> with the tcp library?
>
> AJ ONeal
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Callback Style Preference

2012-05-30 Thread Mark Hahn
I understand.  I'm just being contrary.

>   Node has tried to be very strict about what he version means from the
beginning. pre-1.0 means "stable, but not done".

God forbid it should ever be "done", whatever that means.   I doubt there
will be much difference between v 0.999 and v 1.001.

On a more serious note, what harm does .exists do?  http.createServer
violates all the rules and it is the first thing a node newbie sees.

On Wed, May 30, 2012 at 5:47 PM, Marco Rogers wrote:

> Yes I know that. But that is despite the pre-1.0 version. Node has tried
> to be very strict about what he version means from the beginning. pre-1.0
> means "stable, but not done". Some people think "stable" means "we won't
> break backwards compat". But I'm suggesting that it actually mean "we'll
> try really hard for backwards compat, but we might break things for the
> good of the api". I think in the case of path.exists, this is very doable.
> If we can't do stuff like this now, then we are resigning ourselves to
> being stuck with these warts forever. And path.exists/fs.exists is a
> particular bad wart because it's the exact place people will look for this
> functionality. So the propagation of this will continue to go up.
>
> :Marco
>
>
> On Wednesday, May 30, 2012 5:11:37 PM UTC-7, Mark Hahn wrote:
>>
>> It's like google's "beta" gmail was.
>>
>> On Wed, May 30, 2012 at 5:11 PM, Mark Hahn  wrote:
>>
>>> The ver 1.0 moniker is pretty much meaningless.  Many many people have
>>> it in production.
>>>
>>>
>>> On Wed, May 30, 2012 at 4:49 PM, Marco Rogers wrote:
>>>
 If you're using a pre-1.0 platform, your code is subject to breakage.
 Also you have to opt into upgrading and every major node update has
 required minor changes.

 At some point we went from changing the node api a lot to make it
 better to not changing it at all for fear of crying developers. I'm not
 suggesting we open flood gates. I'm suggesting we continue to refine the
 api and get as close to one with no unnecessary warts as we can before
 going 1.0. Because then we really are screwed.

 :Marco


 On Wednesday, May 30, 2012 3:45:53 PM UTC-7, Mark Hahn wrote:
>
> I would be very unhappy if someone broke my code.  Ask the jquery bdfl
> what happened when he tried to make a non-backwards-compatible change.
>
>  --
 Job Board: http://jobs.nodejs.org/
 Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-
 **Posting-Guidelines
 You received this message because you are subscribed to the Google
 Groups "nodejs" group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscribe@**googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/nodejs?hl=en?hl=en

>>>
>>>
>>  --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Need raw http headers

2012-05-30 Thread mscdex
On May 30, 7:07 pm, AJ ONeal  wrote:
> I'm working on a debugging tool and want to show the actual raw http
> headers (with original case, position, \r\n etc).
>
> Is there any way to go about that without implementing my own http server
> with the tcp library?

Why not just create a tcp server, log the raw input (if that's what
you want), then use the http_parser library manually to parse the
headers/body?

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Callback Style Preference

2012-05-30 Thread Marco Rogers
Yes I know that. But that is despite the pre-1.0 version. Node has tried to 
be very strict about what he version means from the beginning. pre-1.0 
means "stable, but not done". Some people think "stable" means "we won't 
break backwards compat". But I'm suggesting that it actually mean "we'll 
try really hard for backwards compat, but we might break things for the 
good of the api". I think in the case of path.exists, this is very doable. 
If we can't do stuff like this now, then we are resigning ourselves to 
being stuck with these warts forever. And path.exists/fs.exists is a 
particular bad wart because it's the exact place people will look for this 
functionality. So the propagation of this will continue to go up.

:Marco

On Wednesday, May 30, 2012 5:11:37 PM UTC-7, Mark Hahn wrote:
>
> It's like google's "beta" gmail was.
>
> On Wed, May 30, 2012 at 5:11 PM, Mark Hahn  wrote:
>
>> The ver 1.0 moniker is pretty much meaningless.  Many many people have it 
>> in production.
>>
>>
>> On Wed, May 30, 2012 at 4:49 PM, Marco Rogers wrote:
>>
>>> If you're using a pre-1.0 platform, your code is subject to breakage. 
>>> Also you have to opt into upgrading and every major node update has 
>>> required minor changes.
>>>
>>> At some point we went from changing the node api a lot to make it better 
>>> to not changing it at all for fear of crying developers. I'm not suggesting 
>>> we open flood gates. I'm suggesting we continue to refine the api and get 
>>> as close to one with no unnecessary warts as we can before going 1.0. 
>>> Because then we really are screwed.
>>>
>>> :Marco
>>>
>>>
>>> On Wednesday, May 30, 2012 3:45:53 PM UTC-7, Mark Hahn wrote:

 I would be very unhappy if someone broke my code.  Ask the jquery bdfl 
 what happened when he tried to make a non-backwards-compatible change.

  -- 
>>> Job Board: http://jobs.nodejs.org/
>>> Posting guidelines: 
>>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>>> You received this message because you are subscribed to the Google
>>> Groups "nodejs" group.
>>> To post to this group, send email to nodejs@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> nodejs+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>>
>>
>>
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Callback Style Preference

2012-05-30 Thread Mark Hahn
It's like google's "beta" gmail was.

On Wed, May 30, 2012 at 5:11 PM, Mark Hahn  wrote:

> The ver 1.0 moniker is pretty much meaningless.  Many many people have it
> in production.
>
>
> On Wed, May 30, 2012 at 4:49 PM, Marco Rogers wrote:
>
>> If you're using a pre-1.0 platform, your code is subject to breakage.
>> Also you have to opt into upgrading and every major node update has
>> required minor changes.
>>
>> At some point we went from changing the node api a lot to make it better
>> to not changing it at all for fear of crying developers. I'm not suggesting
>> we open flood gates. I'm suggesting we continue to refine the api and get
>> as close to one with no unnecessary warts as we can before going 1.0.
>> Because then we really are screwed.
>>
>> :Marco
>>
>>
>> On Wednesday, May 30, 2012 3:45:53 PM UTC-7, Mark Hahn wrote:
>>>
>>> I would be very unhappy if someone broke my code.  Ask the jquery bdfl
>>> what happened when he tried to make a non-backwards-compatible change.
>>>
>>>  --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines:
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to nodejs@googlegroups.com
>> To unsubscribe from this group, send email to
>> nodejs+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>
>
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Callback Style Preference

2012-05-30 Thread Mark Hahn
The ver 1.0 moniker is pretty much meaningless.  Many many people have it
in production.

On Wed, May 30, 2012 at 4:49 PM, Marco Rogers wrote:

> If you're using a pre-1.0 platform, your code is subject to breakage. Also
> you have to opt into upgrading and every major node update has required
> minor changes.
>
> At some point we went from changing the node api a lot to make it better
> to not changing it at all for fear of crying developers. I'm not suggesting
> we open flood gates. I'm suggesting we continue to refine the api and get
> as close to one with no unnecessary warts as we can before going 1.0.
> Because then we really are screwed.
>
> :Marco
>
>
> On Wednesday, May 30, 2012 3:45:53 PM UTC-7, Mark Hahn wrote:
>>
>> I would be very unhappy if someone broke my code.  Ask the jquery bdfl
>> what happened when he tried to make a non-backwards-compatible change.
>>
>>  --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Best practices for sharing code and data between the server and client

2012-05-30 Thread tjholowaychuk
express-expose is just for small things like maybe exposing some
configuration
to the client, or a little bit of info about a user etc. If you
perform IO for
things like this it can really hurt your UX, but other than that you
should use
something like browserify if you want to share entire modules

On May 30, 4:58 am, Amjad  wrote:
> Hello everybody!
>
> I'm new to the great world of Node.js and have been playing around with
> different modules and frameworks. However, there seems a lot of methods for
> sharing server code with the client, and there are no default way for doing
> that.
>
> I have come across many ideas:
>
> express-expose: this is a nice replacement for parsing JSON objects
> rendered by the the server.https://github.com/visionmedia/express-expose
>
> This article exposes a hack to share backbone models on the Node server,
> and they are trying to neat their hack with their Capsule and Thoonk
> frameworks:http://andyet.net/blog/2011/feb/15/re-using-backbonejs-models-on-the-...
>
> Syncrhonizing Backbone model using 
> socket.iohttps://github.com/scttnlsn/backbone.io
>
> DNode and RPC as a method to use server methods on the client and vice 
> versahttps://github.com/substack/dnode
>
> I know I've mixed a lot of topics, I thought sharing my confusion would
> help to get more clarification, especially that there are a lot of
> production projects based on Node, andI think that the community certainly
> have reached a good collection of concepts and tools for sharing code
> between the server and client. I would be very grateful for sharing your
> thoughts about that.
>
> Best regards,
>
> Amjad
>
> *
> *

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Best practices for sharing code and data between the server and client

2012-05-30 Thread Mark Hahn
It should be called nodeify, not browserify.

On Wed, May 30, 2012 at 4:47 PM, substack  wrote:

> On Wednesday, May 30, 2012 4:58:46 AM UTC-7, al-Amjad Tawfiq Isstaif wrote:
>
>> Hello everybody!
>>
>> I'm new to the great world of Node.js and have been playing around with
>> different modules and frameworks. However, there seems a lot of methods for
>> sharing server code with the client, and there are no default way for doing
>> that.
>>
>
> browserify lets you do node-style require()s in the browser, so a lot of
> node code will just work browser-side, including many packages from npm
> https://github.com/substack/node-browserify
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Callback Style Preference

2012-05-30 Thread Marco Rogers
If you're using a pre-1.0 platform, your code is subject to breakage. Also 
you have to opt into upgrading and every major node update has required 
minor changes.

At some point we went from changing the node api a lot to make it better to 
not changing it at all for fear of crying developers. I'm not suggesting we 
open flood gates. I'm suggesting we continue to refine the api and get as 
close to one with no unnecessary warts as we can before going 1.0. Because 
then we really are screwed.

:Marco

On Wednesday, May 30, 2012 3:45:53 PM UTC-7, Mark Hahn wrote:
>
> I would be very unhappy if someone broke my code.  Ask the jquery bdfl 
> what happened when he tried to make a non-backwards-compatible change.
>
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Best practices for sharing code and data between the server and client

2012-05-30 Thread substack
On Wednesday, May 30, 2012 4:58:46 AM UTC-7, al-Amjad Tawfiq Isstaif wrote:

> Hello everybody!
>
> I'm new to the great world of Node.js and have been playing around with 
> different modules and frameworks. However, there seems a lot of methods for 
> sharing server code with the client, and there are no default way for doing 
> that.
>

browserify lets you do node-style require()s in the browser, so a lot of 
node code will just work browser-side, including many packages from npm 
https://github.com/substack/node-browserify

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: OAuth2 Server

2012-05-30 Thread AJ ONeal
I just created a demo the other night:

https://github.com/coolaj86/node-oauth2-examples

It has a paired provider and consumer so hopefully you can tell what's
really going on. I think it was the one mentioned above (I looked at a few
myself) and it worked well enough as far as I could tell. Relatively simple
codebase.

AJ ONeal

On Tue, May 29, 2012 at 11:29 AM, Gustavo Machado wrote:

> Thank you very much guys, looks like it's the one. Anybody used it in
> production environments?
>
> Thanks,
> Gustavo
>
>
> On Tue, May 29, 2012 at 12:31 AM, Tyler Stalder  wrote:
>
>> I've used Amir's OAuth2 provider. Simple enough, the included example
>> walks through the auth flow.
>>
>> https://github.com/ammmir/node-oauth2-provider
>>
>>
>> On Monday, May 28, 2012 3:18:09 PM UTC-7, Gustavo Machado wrote:
>>>
>>> Hi List!
>>>
>>> Does anybody recommend any production-ready packages to implement OAuth2
>>> Server for my application? This one looks good but doesn't seem to be very
>>> active:
>>>
>>> https://github.com/AF83/**oauth2_server_node
>>>
>>> Thanks in advance!
>>> Gustavo
>>>
>>>
>>>  --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines:
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to nodejs@googlegroups.com
>> To unsubscribe from this group, send email to
>> nodejs+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>
>
>  --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Need raw http headers

2012-05-30 Thread AJ ONeal
I'm working on a debugging tool and want to show the actual raw http
headers (with original case, position, \r\n etc).

Is there any way to go about that without implementing my own http server
with the tcp library?

AJ ONeal

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Callback Style Preference

2012-05-30 Thread Mark Hahn
I would be very unhappy if someone broke my code.  Ask the jquery bdfl what
happened when he tried to make a non-backwards-compatible change.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Callback Style Preference

2012-05-30 Thread Marco Rogers
I don't know why we can't change it. Sure it may break a lot of working 
code. But as you've outlined, replacing it with more preferable methods is 
fairly straight forward. It's even easily shimmable for folks who don't 
want to upgrade. We're talking about breaking nextTick but "can't" get rid 
of this? Doesn't seem logical.

:Marco

On Wednesday, May 30, 2012 9:22:42 AM UTC-7, Isaac Schlueter wrote:
>
> path.exists (moved to fs.exists) is an abomination for so many 
> reasons.  We can't get rid of it, because it's too widely used, but 
> it's really pretty awful.  It predates the cb(er, data) pattern in 
> node, and is one of the very few exceptions to it. 
>
> Any time you find yourself using it, you should try to figure out what 
> you're really trying to find out, and use some other fs call instead. 
> Usually the best approach is to just try to do what you're going to 
> do, and handle the error.  If you're using a file's existence as a 
> lock of some sort, it's better to open the file in O_EXCL mode 
> instead. 
>
>
> On Wed, May 30, 2012 at 7:37 AM, Tim Caswell  wrote: 
> > The most correct value for the error parameter is "undefined", but most 
> of 
> > us are lazy and type "null" instead.  In most code it expects the err 
> > parameter to be either falsy or an Error instance, so it doesn't matter 
> if 
> > you use false, undefined, null, 0, or even "". 
> > 
> > While there are some functions that never emit an error, if there is any 
> > chance they would emit one in the future, save yourself the trouble and 
> > reserve the err parameter.  Also it makes the function work with 
> > flow-control tools and wrappers that assume the pattern. 
> > 
> > 
> > On Wed, May 30, 2012 at 4:05 AM, Mariusz Nowak  
> wrote: 
> >> 
> >> It should be null or undefined only, everything else is a value, and 
> can 
> >> mistakenly accepted as an error. 
> >> 
> >> There are however asynchronous functions that never resolve with an 
> error 
> >> (e.g. path.exists) and as there's no point in always sending null to 
> their 
> >> callbacks, they're designed to pass success value as first argument (in 
> case 
> >> of path.exists true or false). 
> >> 
> >> -- 
> >> Mariusz Nowak - @medikoo 
> >> 
> >> 
> >> On Wednesday, May 30, 2012 3:24:06 AM UTC+2, Daniel R. wrote: 
> >>> 
> >>> Is there consensus on the value to pass to a callback if there isn't 
> >>> an error and there may or may not be a resulting value. A quick survey 
> >>> of node.js code along with popular modules seems to indicate that null 
> >>> is most common but undefined and false also pop up frequently. While 
> >>> any falsey value works I was curious if one was preferred. 
> >>> 
> >>> -- Daniel R.  [http://danielr.neophi.com/] 
> >> 
> >> -- 
> >> Job Board: http://jobs.nodejs.org/ 
> >> Posting guidelines: 
> >> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines 
> >> You received this message because you are subscribed to the Google 
> >> Groups "nodejs" group. 
> >> To post to this group, send email to nodejs@googlegroups.com 
> >> To unsubscribe from this group, send email to 
> >> nodejs+unsubscr...@googlegroups.com 
> >> For more options, visit this group at 
> >> http://groups.google.com/group/nodejs?hl=en?hl=en 
> > 
> > 
> > -- 
> > Job Board: http://jobs.nodejs.org/ 
> > Posting guidelines: 
> > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines 
> > You received this message because you are subscribed to the Google 
> > Groups "nodejs" group. 
> > To post to this group, send email to nodejs@googlegroups.com 
> > To unsubscribe from this group, send email to 
> > nodejs+unsubscr...@googlegroups.com 
> > For more options, visit this group at 
> > http://groups.google.com/group/nodejs?hl=en?hl=en 
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Faster 32-bit hashes

2012-05-30 Thread mscdex
On May 30, 3:25 pm, Dan Shaw  wrote:
> I'd be interested. Is performance really that good?

Well, on my Core i7-860 for a 709mb file I get these results:

xxhash-strong: ~140ms
xxhash-fast: ~80ms
crc32 (from mhash): ~2000ms
adler32 (from mhash): ~1500ms
md5: ~998ms
sha1: ~1162ms

I realize the latter two are not 32-bit hashes, but I threw them in
there just for fun.


I've uploaded the binding to github[1] and to npm as `xxhash`.


[1] https://github.com/mscdex/node-xxhash

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Faster 32-bit hashes

2012-05-30 Thread Dan Shaw
mscdex,

I'd be interested. Is performance really that good?
Please push to github and npm.

Daniel Shaw
@dshaw


On Wed, May 30, 2012 at 10:05 AM, mscdex  wrote:
> FWIW I wrote a little node binding to xxhash[1] not too long ago. I
> can upload it to github if anyone is interested.
>
> [1] http://code.google.com/p/xxhash/
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: asynchronous Socket

2012-05-30 Thread Sky Chen
Maybe you can consider socket.io, which handle most of the things for you.

Here is an example: 

http://fbwebsocket.nodester.com/

http://socket.io/

Thanks and Regards,

Sky

Tim Caswell  於 2012/5/28 下午11:41 寫道:

> This is a common problem porting blocking code to node.  If you block on 
> network sockets in node, it will destroy the performance of your server.  
> There is only one thread.  The server will be unable to serve multiple 
> connections at once if one is blocking.
> 
> Why are you porting this to node?  This requirement is fundamentally 
> incompatible with the design of node.  If you want the awesome concurrent 
> socket performance capabilities of node, this is only done by never using 
> blocking I/O.
> 
> So assuming you want to port to node anyway, the code's structure will have 
> to be modified to accommodate for the async requirements of node. 
> (Technically you could modify node through a C addon to have multiple threads 
> and block the thread, but that's not going to scale near as well as a single 
> thread using non-blocking code due to the high cost of thread context 
> switching and thread syncing)
> 
> On Mon, May 28, 2012 at 5:02 AM, Oleg Podsechin  
> wrote:
> as an example of what i have:
> 
> var socket = new SocketSync();
> socket.open('localhost', 8856);
> socket.write('my request');
> var mydata= socket.read();
> socket.end();
> 
> Check out the "socket" module in Common Node: 
> https://github.com/olegp/common-node
> 
> Here's the canonical chat example written using the lib: 
> https://github.com/olegp/common-node/blob/master/examples/chat.js
> 
> In your code above, "SocketSync" becomes "Socket" and "open" becomes 
> "connect". Everything else should work as is.
> 
> Oleg
> -- 
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
> 
> -- 
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Social Chat Room prototype - feel free to try and comment

2012-05-30 Thread Sky Chen
Hi all,

I developed a IRC like chat room prototype with Node.js + Socket.io.
It integrated with Facebook and Google login.

Your comments and suggestions are highly appreciated.

http://fbwebsocket.nodester.com

Cheers,
Sky

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] NPM can't install appjs. Error: Cannot find module 'graceful-fs'

2012-05-30 Thread Zephlon Arphanosh
I installed node.js and npm already, but when I try to install appjs I
get this error:

zephlon@zephlon-T5254:~$ npm install appjs

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
  ^
Error: Cannot find module 'graceful-fs'
at Function._resolveFilename (module.js:334:11)
at Function._load (module.js:279:25)
at Module.require (module.js:357:17)
at require (module.js:368:17)
at Object. (/usr/share/npm/lib/utils/ini.js:32:10)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Module.require (module.js:357:17)
I get similar errors on any attempt to install graceful-fs.

I am using Ubuntu 12.04 LTS.

Here's the link to the appjs website: http://appjs.org/

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] VHOST-Proxy

2012-05-30 Thread Marak Squires
There are several entry points into the proxying API

https://github.com/nodejitsu/node-http-proxy/blob/master/examples/http/standalone-proxy.js

On Tue, May 29, 2012 at 1:16 AM, Axel Kittenberger  wrote:

> No. All of the examples proxy through httpProxy.createServer
>
> On Tue, May 29, 2012 at 9:48 AM, Marak Squires 
> wrote:
> > Yes. https://github.com/nodejitsu/node-http-proxy/tree/master/examples
> >
> >
> > On Tue, May 29, 2012 at 12:25 AM, Axel Kittenberger 
> > wrote:
> >>
> >> Thank you.
> >>
> >> The thing that confuses me is, why httpProxy.createServer(...);
> >>
> >> Cant I just create http.createServer() handle requests normally for
> >> the main node site, and in my request handler create a proxyRequst
> >> only when it relates the VHOST?
> >>
> >> On Tue, May 29, 2012 at 9:14 AM, Oliver Leics 
> >> wrote:
> >> > var httpProxy = require('http-proxy')
> >> >  ;
> >> >
> >> > httpProxy.createServer(options, function(req, res, proxy) {
> >> >  if(req.headers.host === 'whatever.example.com') {
> >> >proxy.proxyRequest(req, res,
> >> >  { host: 'localhost'
> >> >  , port: '8080'
> >> >  }
> >> >)
> >> >return
> >> >  }
> >> >  res.writeHead(400, {})
> >> >  res.write('Bad Request: Missing "Host"')
> >> >  res.end()
> >> > })
> >> >
> >> > - o
> >> >
> >> > On Tue, May 29, 2012 at 9:06 AM, Axel Kittenberger 
> >> > wrote:
> >> >> Hi list, yet another question (I know its getting much in the last
> days
> >> >> :-).
> >> >>
> >> >> Suppose I want to host a second legacy website with Apache-PhP on my
> >> >> VPS otherwise running awesome node.js (not my blog, its yet something
> >> >> else). So I check request.headers.host and if its the VHOST for the
> >> >> legacy website, I want to proxy that request to say localhost port
> >> >> 8080 running the Apache.
> >> >>
> >> >> Any code snippets to properly and compactly proxy GET as well  POST
> >> >> requests?
> >> >>
> >> >> I've seen node-http-proxy, but its Documentation only explains howto
> >> >> set up a standalone (reverse)proxy rather than integrate it to an
> >> >> existing node.js server occupying the port 80.
> >> >>
> >> >> --
> >> >> Job Board: http://jobs.nodejs.org/
> >> >> Posting guidelines:
> >> >> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> >> >> You received this message because you are subscribed to the Google
> >> >> Groups "nodejs" group.
> >> >> To post to this group, send email to nodejs@googlegroups.com
> >> >> To unsubscribe from this group, send email to
> >> >> nodejs+unsubscr...@googlegroups.com
> >> >> For more options, visit this group at
> >> >> http://groups.google.com/group/nodejs?hl=en?hl=en
> >> >
> >> >
> >> >
> >> > --
> >> > Oliver Leics @ G+
> >> > https://plus.google.com/112912441146721682527
> >> >
> >> > --
> >> > Job Board: http://jobs.nodejs.org/
> >> > Posting guidelines:
> >> > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> >> > You received this message because you are subscribed to the Google
> >> > Groups "nodejs" group.
> >> > To post to this group, send email to nodejs@googlegroups.com
> >> > To unsubscribe from this group, send email to
> >> > nodejs+unsubscr...@googlegroups.com
> >> > For more options, visit this group at
> >> > http://groups.google.com/group/nodejs?hl=en?hl=en
> >>
> >> --
> >> Job Board: http://jobs.nodejs.org/
> >> Posting guidelines:
> >> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> >> You received this message because you are subscribed to the Google
> >> Groups "nodejs" group.
> >> To post to this group, send email to nodejs@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> nodejs+unsubscr...@googlegroups.com
> >> For more options, visit this group at
> >> http://groups.google.com/group/nodejs?hl=en?hl=en
> >
> >
> >
> >
> > --
> > --
> > Marak Squires
> > Co-founder and Chief Evangelist
> > Nodejitsu, Inc.
> > marak.squi...@gmail.com
> >
> > --
> > Job Board: http://jobs.nodejs.org/
> > Posting guidelines:
> > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> > You received this message because you are subscribed to the Google
> > Groups "nodejs" group.
> > To post to this group, send email to nodejs@googlegroups.com
> > To unsubscribe from this group, send email to
> > nodejs+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/nodejs?hl=en?hl=en
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>



-- 
-- 
Marak Squires
Co-founder and Chief Evangelist
Nodejitsu, Inc.
ma

Re: [nodejs][ANN] siege.js by kissjs.org publish 0.0.2

2012-05-30 Thread Matt
.on()?

That's rather confusing considering how much .on() is used in Node for
event emitters. I assume you mean .port()?

On Wed, May 30, 2012 at 3:45 AM, jason.桂林  wrote:

> I forgot add an example for it.
>
> siege()
> .host('localhost')
> .on(3000)
> .get('/')
> .attack();
>
> 2012/5/29 Osher El-Netanany 
>
>> What can we do to add the ability to siege an external server?
>> I mean - instead of providing app.js - I want to provide a base URL to an
>> exteranal server.
>>
>> Do you think it is simple to add? :)
>>
>> On Sun, May 6, 2012 at 7:04 PM, jason.桂林  wrote:
>>
>>>  siege.js is a http benchmark module.
>>>
>>> features:
>>>
>>> * benchmark with keep alive connection, (useful on mac os)
>>> * colorful report
>>> * multiple task define
>>> * cookie support (>= 0.0.2)
>>>
>>> example:
>>>
>>> siege()
   .on(3000)
   .for(1).times
   .get('/')
   .attack()
>>>
>>>
>>> for a nodejs app.js, which module.exports = function(req, res), you can
>>> use siege start your server, before benchmark, and close server after
>>> benchmark.
>>>
>>> siege(__dirname + '/app.js')
   .on(4000)
   .withCookie
   .for(1).times
   .concurrent(100)
   .get('/set-cookie')
   .get('/get-cookie')
   .get('/').withoutCookie
   .attack()
>>>
>>>
>>> enjoy it.
>>>
>>> by kissjs.org.
>>>
>>> We are looking for collaborators.
>>> --
>>> Best regards,
>>>
>>> 桂林 (Gui Lin)
>>>
>>> guileen@twitter
>>> 桂林-V@weibo 
>>> guileen@github 
>>>
>>>  --
>>> Job Board: http://jobs.nodejs.org/
>>> Posting guidelines:
>>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>>> You received this message because you are subscribed to the Google
>>> Groups "nodejs" group.
>>> To post to this group, send email to nodejs@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> nodejs+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>>
>>
>>  --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines:
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to nodejs@googlegroups.com
>> To unsubscribe from this group, send email to
>> nodejs+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>
>
>
>
> --
> Best regards,
>
> 桂林 (Gui Lin)
>
> guileen@twitter 
> 桂糊涂@weibo 
> guileen@github 
>
>  --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Sample CRUD app source code

2012-05-30 Thread Angel Java Lopez
Ok, but without using libraries:

- You must implement the route analysis, parsing of parameters, body post,
serving static files (text, images...), etc..
- Do you want to use a database, or an in memory model? Or maybe, a model
serialized in JSON? That is, you are interested more in manage
the intricacies of require('http') and its power, or to learn about how to
access and manage databases?
- Without libraries, then, no template engine? simple res.write?



On Wed, May 30, 2012 at 2:51 PM, Adem Aydin  wrote:

> Hi Tim,
> my main goal is to write a rating system and play with the aggregated data
> (i.e. compare the rating of items of the same type, a rating timeline of
> one item and so on). But to reach this goal, I need to learn how to write a
> basic list which can be extended and how to edit or delete existing items.
>
> For example:
>
> example.com/
> index page containing the app explanation and the links to the different
> routes
>
> example.com/category
> display all items of the same category, sorted by rating.
>
> example.com/category/someitemname
> detailed rating information about that particular item, including the
> rating ratio (1 to 5 stars), rating timeline (I'd like to draw with canvas)
>
> This is just an idea I had in mind. As I said, for me it's important to
> know how to write a simple index of items which I can delete and edit.
>
> PS: howtonode has been a good resource, thank you!
>
> Adem
>
>
>  On Wednesday, May 30, 2012 6:13:17 PM UTC+2, Tim Caswell wrote:
>>
>> If you write up the requirements for the simple app I can write up an
>> example.  I need this for talks I give anyway, but I have trouble coming up
>> with the sample apps.  Just keep it simple.  What are you trying to
>> learn exactly?
>>
>> On Wed, May 30, 2012 at 10:47 AM, Adem Aydin  wrote:
>>
>>> Hello,
>>> As a node.js novice I am trying to get myself working productively with
>>> it. However, I'm still searching for a sample CRUD application which is
>>> purely built without any libraries. This would allow me to see how to
>>> handle routes, GET/POST requests and HTML templating WITHOUT express.js etc.
>>>
>>> Do you guys know of such an application source (or provide me with
>>> snippets?)
>>>
>>> Thank you very much!
>>> Adem
>>>
>>> --
>>> Job Board: http://jobs.nodejs.org/
>>> Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-*
>>> *Posting-Guidelines
>>> You received this message because you are subscribed to the Google
>>> Groups "nodejs" group.
>>> To post to this group, send email to nodejs@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> nodejs+unsubscribe@**googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/**group/nodejs?hl=en?hl=en
>>>
>>
>>
> On Wednesday, May 30, 2012 6:13:17 PM UTC+2, Tim Caswell wrote:
>>
>> If you write up the requirements for the simple app I can write up an
>> example.  I need this for talks I give anyway, but I have trouble coming up
>> with the sample apps.  Just keep it simple.  What are you trying to
>> learn exactly?
>>
>> On Wed, May 30, 2012 at 10:47 AM, Adem Aydin  wrote:
>>
>>> Hello,
>>> As a node.js novice I am trying to get myself working productively with
>>> it. However, I'm still searching for a sample CRUD application which is
>>> purely built without any libraries. This would allow me to see how to
>>> handle routes, GET/POST requests and HTML templating WITHOUT express.js etc.
>>>
>>> Do you guys know of such an application source (or provide me with
>>> snippets?)
>>>
>>> Thank you very much!
>>> Adem
>>>
>>> --
>>> Job Board: http://jobs.nodejs.org/
>>> Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-*
>>> *Posting-Guidelines
>>> You received this message because you are subscribed to the Google
>>> Groups "nodejs" group.
>>> To post to this group, send email to nodejs@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> nodejs+unsubscribe@**googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/**group/nodejs?hl=en?hl=en
>>>
>>
>>
> On Wednesday, May 30, 2012 6:13:17 PM UTC+2, Tim Caswell wrote:
>>
>> If you write up the requirements for the simple app I can write up an
>> example.  I need this for talks I give anyway, but I have trouble coming up
>> with the sample apps.  Just keep it simple.  What are you trying to
>> learn exactly?
>>
>> On Wed, May 30, 2012 at 10:47 AM, Adem Aydin  wrote:
>>
>>> Hello,
>>> As a node.js novice I am trying to get myself working productively with
>>> it. However, I'm still searching for a sample CRUD application which is
>>> purely built without any libraries. This would allow me to see how to
>>> handle routes, GET/POST requests and HT

Re: [nodejs] Sample CRUD app source code

2012-05-30 Thread john.tiger

Tim,
why don't you pick one of the standard examples (todo, blog) - this 
would make it easy to compare to other languages, frameworks, etc




On 05/30/2012 10:13 AM, Tim Caswell wrote:
If you write up the requirements for the simple app I can write up an 
example.  I need this for talks I give anyway, but I have trouble 
coming up with the sample apps.  Just keep it simple.  What are you 
trying to learn exactly?


On Wed, May 30, 2012 at 10:47 AM, Adem Aydin > wrote:


Hello,
As a node.js novice I am trying to get myself working productively
with it. However, I'm still searching for a sample CRUD
application which is purely built without any libraries. This
would allow me to see how to handle routes, GET/POST requests and
HTML templating WITHOUT express.js etc.

Do you guys know of such an application source (or provide me with
snippets?)

Thank you very much!
Adem

--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com

To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com

For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


--
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines

You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


--
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Sample CRUD app source code

2012-05-30 Thread Adem Aydin
Hi Tim, 
my main goal is to write a rating system and play with the aggregated data 
(i.e. compare the rating of items of the same type, a rating timeline of 
one item and so on). But to reach this goal, I need to learn how to write a 
basic list which can be extended and how to edit or delete existing items.

For example:

example.com/
index page containing the app explanation and the links to the different 
routes

example.com/category
display all items of the same category, sorted by rating. 

example.com/category/someitemname
detailed rating information about that particular item, including the 
rating ratio (1 to 5 stars), rating timeline (I'd like to draw with canvas)

This is just an idea I had in mind. As I said, for me it's important to 
know how to write a simple index of items which I can delete and edit.

PS: howtonode has been a good resource, thank you!

Adem


 On Wednesday, May 30, 2012 6:13:17 PM UTC+2, Tim Caswell wrote:
>
> If you write up the requirements for the simple app I can write up an 
> example.  I need this for talks I give anyway, but I have trouble coming up 
> with the sample apps.  Just keep it simple.  What are you trying to 
> learn exactly?
>
> On Wed, May 30, 2012 at 10:47 AM, Adem Aydin  wrote:
>
>> Hello,
>> As a node.js novice I am trying to get myself working productively with 
>> it. However, I'm still searching for a sample CRUD application which is 
>> purely built without any libraries. This would allow me to see how to 
>> handle routes, GET/POST requests and HTML templating WITHOUT express.js etc.
>>
>> Do you guys know of such an application source (or provide me with 
>> snippets?)
>>
>> Thank you very much!
>> Adem
>>
>> --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines: 
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to nodejs@googlegroups.com
>> To unsubscribe from this group, send email to
>> nodejs+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>
>
>
On Wednesday, May 30, 2012 6:13:17 PM UTC+2, Tim Caswell wrote:
>
> If you write up the requirements for the simple app I can write up an 
> example.  I need this for talks I give anyway, but I have trouble coming up 
> with the sample apps.  Just keep it simple.  What are you trying to 
> learn exactly?
>
> On Wed, May 30, 2012 at 10:47 AM, Adem Aydin  wrote:
>
>> Hello,
>> As a node.js novice I am trying to get myself working productively with 
>> it. However, I'm still searching for a sample CRUD application which is 
>> purely built without any libraries. This would allow me to see how to 
>> handle routes, GET/POST requests and HTML templating WITHOUT express.js etc.
>>
>> Do you guys know of such an application source (or provide me with 
>> snippets?)
>>
>> Thank you very much!
>> Adem
>>
>> --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines: 
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to nodejs@googlegroups.com
>> To unsubscribe from this group, send email to
>> nodejs+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>
>
>
On Wednesday, May 30, 2012 6:13:17 PM UTC+2, Tim Caswell wrote:
>
> If you write up the requirements for the simple app I can write up an 
> example.  I need this for talks I give anyway, but I have trouble coming up 
> with the sample apps.  Just keep it simple.  What are you trying to 
> learn exactly?
>
> On Wed, May 30, 2012 at 10:47 AM, Adem Aydin  wrote:
>
>> Hello,
>> As a node.js novice I am trying to get myself working productively with 
>> it. However, I'm still searching for a sample CRUD application which is 
>> purely built without any libraries. This would allow me to see how to 
>> handle routes, GET/POST requests and HTML templating WITHOUT express.js etc.
>>
>> Do you guys know of such an application source (or provide me with 
>> snippets?)
>>
>> Thank you very much!
>> Adem
>>
>> --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines: 
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to nodejs@googlegroups.com
>> To unsubscribe from this group, send email to
>> nodejs+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>
>
>
On Wednesday, May 30, 2012 6:13:17 PM UTC+2, Tim Caswell wrote:
>
> If you write up the requirements for the simple app I can write up an 
> example.  I need this for talks I give anyway, but I have trouble coming up 
> with 

Re: [nodejs] Sample CRUD app source code

2012-05-30 Thread ben
sorry didn't see that you want to do it without any lib. just ignore
the last post.

On Thu, May 31, 2012 at 1:35 AM, ben  wrote:
> this might help
> https://github.com/dreamerslab/express-todo-example
>
> also there is an online demo
> http://express-todo-example.dreamerslab.com/
>
> ben :)
>
> On Thu, May 31, 2012 at 12:13 AM, Tim Caswell  wrote:
>> If you write up the requirements for the simple app I can write up an
>> example.  I need this for talks I give anyway, but I have trouble coming up
>> with the sample apps.  Just keep it simple.  What are you trying to
>> learn exactly?
>>
>>
>> On Wed, May 30, 2012 at 10:47 AM, Adem Aydin  wrote:
>>>
>>> Hello,
>>> As a node.js novice I am trying to get myself working productively with
>>> it. However, I'm still searching for a sample CRUD application which is
>>> purely built without any libraries. This would allow me to see how to handle
>>> routes, GET/POST requests and HTML templating WITHOUT express.js etc.
>>>
>>> Do you guys know of such an application source (or provide me with
>>> snippets?)
>>>
>>> Thank you very much!
>>> Adem
>>>
>>> --
>>> Job Board: http://jobs.nodejs.org/
>>> Posting guidelines:
>>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>>> You received this message because you are subscribed to the Google
>>> Groups "nodejs" group.
>>> To post to this group, send email to nodejs@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> nodejs+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>
>>
>> --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines:
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to nodejs@googlegroups.com
>> To unsubscribe from this group, send email to
>> nodejs+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Sample CRUD app source code

2012-05-30 Thread ben
this might help
https://github.com/dreamerslab/express-todo-example

also there is an online demo
http://express-todo-example.dreamerslab.com/

ben :)

On Thu, May 31, 2012 at 12:13 AM, Tim Caswell  wrote:
> If you write up the requirements for the simple app I can write up an
> example.  I need this for talks I give anyway, but I have trouble coming up
> with the sample apps.  Just keep it simple.  What are you trying to
> learn exactly?
>
>
> On Wed, May 30, 2012 at 10:47 AM, Adem Aydin  wrote:
>>
>> Hello,
>> As a node.js novice I am trying to get myself working productively with
>> it. However, I'm still searching for a sample CRUD application which is
>> purely built without any libraries. This would allow me to see how to handle
>> routes, GET/POST requests and HTML templating WITHOUT express.js etc.
>>
>> Do you guys know of such an application source (or provide me with
>> snippets?)
>>
>> Thank you very much!
>> Adem
>>
>> --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines:
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to nodejs@googlegroups.com
>> To unsubscribe from this group, send email to
>> nodejs+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: stdin is "paused" or open/resumed?

2012-05-30 Thread mscdex
On May 30, 12:41 pm, José F. Romaniello 
wrote:
> well the subject is self explanatory. I want to know if process.stdin is
> open (means it was "resumed") or paused.

It is paused on startup, so you'll have to resume it at the top of
your program if you want to start capturing from stdin right away.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Faster 32-bit hashes

2012-05-30 Thread mscdex
FWIW I wrote a little node binding to xxhash[1] not too long ago. I
can upload it to github if anyone is interested.

[1] http://code.google.com/p/xxhash/

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Streaming asynchronous template engine

2012-05-30 Thread Oliver Leics
On Wed, May 30, 2012 at 5:04 PM, Tim Caswell  wrote:
> It did while I was developing it, but I removed the feature because I
> couldn't find a real-world use-case that needed it.  It's pretty trivial to
> add back in if you need it.  I can publish a new version if you otherwise
> like the language.
>
> The API adjustment would be to return a stream if you don't pass in a
> callback.  The stream would emit "error" on error, "data" when a chunk is
> ready to be flushed and "end" when done.

Thank you very much for the offer, I'll keep that in mind.

ATM I'm still evaluating the topic in general and if it makes
sense/works well with the system i already have.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Streaming asynchronous template engine

2012-05-30 Thread Oliver Leics
On Wed, May 30, 2012 at 5:15 PM, Tim Caswell  wrote:
> On Wed, May 30, 2012 at 7:15 AM, Oliver Leics 
> wrote:
>>
>> Hallo,
>>
>> is dustjs[1] really the only template engine that implements rt
>> streamed render output and supports asynchronous calls within
>> template-functions?
>
> I will say I'm glad you're looking for this.  I've been making this kind of
> template language for years (Grain, Corn, Kernel, etc) and it's never seemed
> to catch on.  People say it's neat and I should port it to the browser and
> yeah, it's neat (yes I repeated that).  But then the next day it's like the
> project never existed.

I played around for one day with streaming template engines and at the
moment I'm very optimistic that this can work well:

Take several local servers serving the single parts of one html-page
(login/logout, navigation, tagcloud, blogposts, whoisonline, ect pp)
and one server with - say - dustjs as the template engine to fetch all
the parts of the html-page from the local servers and combine them
into one single html-page. Don't wait until the whole page is in
memory, but immediately stream the rendered output to the client.

I hope you all get the idea. And tell me if I am just insane, as it is
absolutely possible that I really am, because I'm just too exited and
find that out later by myself ;-)

> I don't know if the idea is too foreign for people or if there is no real
> need for it.  I used it for a real project and I like it.  It feels like the
> good parts to PHP without all the ugly..

I would like to see something with the power of PHPs Smarty Template
Engine for node.js with all the benefits node.js brings us. But most
importantly such a template engine must be as much as _designer
friendly_ as PHPs Smarty already is: Easy syntax, easy to design with,
easy to extend with plugins; Plugins made by programmers.

That would open the doors to the node.js and serverside javascript
world for much more people.

But maybe I'm just too exited atm, thus playing the prophet.

-o

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Faster 32-bit hashes

2012-05-30 Thread Mark Hahn
Don't get me wrong.  Knowing how the internals of V8 works is very useful.
 Thanks for pointing this out.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Faster 32-bit hashes

2012-05-30 Thread Stewart Mckinney
Also, isn't it not the key size, but the # of keys?

On Wed, May 30, 2012 at 12:45 PM, Stewart Mckinney wrote:

> Is there any quantification on what "N" might be?
>
> On Wed, May 30, 2012 at 12:29 PM, Joran Greef  wrote:
>
>> Hash implementation quality being equal, C++ may be faster for hash
>> inputs greater than N bytes where the cost of jumping between JS and C++
>> does not outweigh the benefit. For keys smaller than N bytes, hashing in JS
>> may be faster.
>>
>> On Wednesday, May 30, 2012 6:17:17 PM UTC+2, Mark Hahn wrote:
>>>
>>> Are you talking about calculating the hash in javascript?  If so then a
>>> third way, using a C++ extension, would be much faster than either 31 or 32.
>>>
>>> On Wed, May 30, 2012 at 8:05 AM, Joran Greef  wrote:
>>>
 If you're doing 32-bit hashes in Javascript and are willing to trade a
 bit, then a 31-bit hash may be at least an order of magnitude faster:
 https://groups.google.com/d/**msg/v8-users/zGCS_wEMawU/**6mConTiBUyMJ

 --
 Job Board: http://jobs.nodejs.org/
 Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-
 **Posting-Guidelines
 You received this message because you are subscribed to the Google
 Groups "nodejs" group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscribe@**googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/nodejs?hl=en?hl=en

>>>
>>>  --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines:
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to nodejs@googlegroups.com
>> To unsubscribe from this group, send email to
>> nodejs+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>
>
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Faster 32-bit hashes

2012-05-30 Thread Stewart Mckinney
Is there any quantification on what "N" might be?

On Wed, May 30, 2012 at 12:29 PM, Joran Greef  wrote:

> Hash implementation quality being equal, C++ may be faster for hash inputs
> greater than N bytes where the cost of jumping between JS and C++ does not
> outweigh the benefit. For keys smaller than N bytes, hashing in JS may be
> faster.
>
> On Wednesday, May 30, 2012 6:17:17 PM UTC+2, Mark Hahn wrote:
>>
>> Are you talking about calculating the hash in javascript?  If so then a
>> third way, using a C++ extension, would be much faster than either 31 or 32.
>>
>> On Wed, May 30, 2012 at 8:05 AM, Joran Greef  wrote:
>>
>>> If you're doing 32-bit hashes in Javascript and are willing to trade a
>>> bit, then a 31-bit hash may be at least an order of magnitude faster:
>>> https://groups.google.com/d/**msg/v8-users/zGCS_wEMawU/**6mConTiBUyMJ
>>>
>>> --
>>> Job Board: http://jobs.nodejs.org/
>>> Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-*
>>> *Posting-Guidelines
>>> You received this message because you are subscribed to the Google
>>> Groups "nodejs" group.
>>> To post to this group, send email to nodejs@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> nodejs+unsubscribe@**googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/**group/nodejs?hl=en?hl=en
>>>
>>
>>  --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] stdin is "paused" or open/resumed?

2012-05-30 Thread José F . Romaniello
well the subject is self explanatory. I want to know if process.stdin is 
open (means it was "resumed") or paused.

thank you very much

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Faster 32-bit hashes

2012-05-30 Thread Joran Greef
Hash implementation quality being equal, C++ may be faster for hash inputs 
greater than N bytes where the cost of jumping between JS and C++ does not 
outweigh the benefit. For keys smaller than N bytes, hashing in JS may be 
faster.

On Wednesday, May 30, 2012 6:17:17 PM UTC+2, Mark Hahn wrote:
>
> Are you talking about calculating the hash in javascript?  If so then a 
> third way, using a C++ extension, would be much faster than either 31 or 32.
>
> On Wed, May 30, 2012 at 8:05 AM, Joran Greef  wrote:
>
>> If you're doing 32-bit hashes in Javascript and are willing to trade a 
>> bit, then a 31-bit hash may be at least an order of magnitude faster: 
>> https://groups.google.com/d/msg/v8-users/zGCS_wEMawU/6mConTiBUyMJ
>>
>> -- 
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines: 
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to nodejs@googlegroups.com
>> To unsubscribe from this group, send email to
>> nodejs+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>
>
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Callback Style Preference

2012-05-30 Thread Isaac Schlueter
path.exists (moved to fs.exists) is an abomination for so many
reasons.  We can't get rid of it, because it's too widely used, but
it's really pretty awful.  It predates the cb(er, data) pattern in
node, and is one of the very few exceptions to it.

Any time you find yourself using it, you should try to figure out what
you're really trying to find out, and use some other fs call instead.
Usually the best approach is to just try to do what you're going to
do, and handle the error.  If you're using a file's existence as a
lock of some sort, it's better to open the file in O_EXCL mode
instead.


On Wed, May 30, 2012 at 7:37 AM, Tim Caswell  wrote:
> The most correct value for the error parameter is "undefined", but most of
> us are lazy and type "null" instead.  In most code it expects the err
> parameter to be either falsy or an Error instance, so it doesn't matter if
> you use false, undefined, null, 0, or even "".
>
> While there are some functions that never emit an error, if there is any
> chance they would emit one in the future, save yourself the trouble and
> reserve the err parameter.  Also it makes the function work with
> flow-control tools and wrappers that assume the pattern.
>
>
> On Wed, May 30, 2012 at 4:05 AM, Mariusz Nowak  wrote:
>>
>> It should be null or undefined only, everything else is a value, and can
>> mistakenly accepted as an error.
>>
>> There are however asynchronous functions that never resolve with an error
>> (e.g. path.exists) and as there's no point in always sending null to their
>> callbacks, they're designed to pass success value as first argument (in case
>> of path.exists true or false).
>>
>> --
>> Mariusz Nowak - @medikoo
>>
>>
>> On Wednesday, May 30, 2012 3:24:06 AM UTC+2, Daniel R. wrote:
>>>
>>> Is there consensus on the value to pass to a callback if there isn't
>>> an error and there may or may not be a resulting value. A quick survey
>>> of node.js code along with popular modules seems to indicate that null
>>> is most common but undefined and false also pop up frequently. While
>>> any falsey value works I was curious if one was preferred.
>>>
>>> -- Daniel R.  [http://danielr.neophi.com/]
>>
>> --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines:
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to nodejs@googlegroups.com
>> To unsubscribe from this group, send email to
>> nodejs+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Faster 32-bit hashes

2012-05-30 Thread Mark Hahn
Are you talking about calculating the hash in javascript?  If so then a
third way, using a C++ extension, would be much faster than either 31 or 32.

On Wed, May 30, 2012 at 8:05 AM, Joran Greef  wrote:

> If you're doing 32-bit hashes in Javascript and are willing to trade a
> bit, then a 31-bit hash may be at least an order of magnitude faster:
> https://groups.google.com/d/msg/v8-users/zGCS_wEMawU/6mConTiBUyMJ
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Sample CRUD app source code

2012-05-30 Thread Tim Caswell
If you write up the requirements for the simple app I can write up an
example.  I need this for talks I give anyway, but I have trouble coming up
with the sample apps.  Just keep it simple.  What are you trying to
learn exactly?

On Wed, May 30, 2012 at 10:47 AM, Adem Aydin  wrote:

> Hello,
> As a node.js novice I am trying to get myself working productively with
> it. However, I'm still searching for a sample CRUD application which is
> purely built without any libraries. This would allow me to see how to
> handle routes, GET/POST requests and HTML templating WITHOUT express.js etc.
>
> Do you guys know of such an application source (or provide me with
> snippets?)
>
> Thank you very much!
> Adem
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Sample CRUD app source code

2012-05-30 Thread Adem Aydin
Hello,
As a node.js novice I am trying to get myself working productively with it. 
However, I'm still searching for a sample CRUD application which is purely 
built without any libraries. This would allow me to see how to handle routes, 
GET/POST requests and HTML templating WITHOUT express.js etc.

Do you guys know of such an application source (or provide me with snippets?)

Thank you very much!
Adem

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Streaming asynchronous template engine

2012-05-30 Thread Tim Caswell
On Wed, May 30, 2012 at 7:15 AM, Oliver Leics wrote:

> Hallo,
>
> is dustjs[1] really the only template engine that implements rt
> streamed render output and supports asynchronous calls within
> template-functions?
>

I will say I'm glad you're looking for this.  I've been making this kind of
template language for years (Grain, Corn, Kernel, etc) and it's never
seemed to catch on.  People say it's neat and I should port it to the
browser and yeah, it's neat (yes I repeated that).  But then the next day
it's like the project never existed.

I don't know if the idea is too foreign for people or if there is no real
need for it.  I used it for a real project and I like it.  It feels like
the good parts to PHP without all the ugly..




>
> [1] https://github.com/akdubya/dustjs
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Faster 32-bit hashes

2012-05-30 Thread Joran Greef
If you're doing 32-bit hashes in Javascript and are willing to trade a bit, 
then a 31-bit hash may be at least an order of magnitude faster: 
https://groups.google.com/d/msg/v8-users/zGCS_wEMawU/6mConTiBUyMJ

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Streaming asynchronous template engine

2012-05-30 Thread Tim Caswell
It did while I was developing it, but I removed the feature because I
couldn't find a real-world use-case that needed it.  It's pretty trivial to
add back in if you need it.  I can publish a new version if you otherwise
like the language.

The API adjustment would be to return a stream if you don't pass in a
callback.  The stream would emit "error" on error, "data" when a chunk is
ready to be flushed and "end" when done.

On Wed, May 30, 2012 at 10:01 AM, Oliver Leics wrote:

> @Tim: Does Kernel stream the output while rendering?
>
> On Wed, May 30, 2012 at 4:50 PM, Tim Caswell  wrote:
> > Corn is unmaintained, but the replacement it
> https://github.com/c9/kernel
> >
> > Kernel is extremely simple, but powerful through helper functions that
> > accept blocks.  Even though the language doesn't have conditionals or
> loops,
> > they are easy to implement as helpers.
> >
> > In nodebits.org, I use kernel.  I have helpers that do things like
> "Make a
> > database query and loop over the results using the block as a template"
> >  It's great!
> >
> >
> > On Wed, May 30, 2012 at 7:19 AM, Arnout Kazemier 
> wrote:
> >>
> >> https://github.com/creationix/corn ?
> >>
> >> On Wednesday, May 30, 2012 at 2:15 PM, Oliver Leics wrote:
> >>
> >> Hallo,
> >>
> >> is dustjs[1] really the only template engine that implements rt
> >> streamed render output and supports asynchronous calls within
> >> template-functions?
> >>
> >> [1] https://github.com/akdubya/dustjs
> >>
> >> --
> >> Job Board: http://jobs.nodejs.org/
> >> Posting guidelines:
> >> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> >> You received this message because you are subscribed to the Google
> >> Groups "nodejs" group.
> >> To post to this group, send email to nodejs@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> nodejs+unsubscr...@googlegroups.com
> >> For more options, visit this group at
> >> http://groups.google.com/group/nodejs?hl=en?hl=en
> >>
> >>
> >> --
> >> Job Board: http://jobs.nodejs.org/
> >> Posting guidelines:
> >> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> >> You received this message because you are subscribed to the Google
> >> Groups "nodejs" group.
> >> To post to this group, send email to nodejs@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> nodejs+unsubscr...@googlegroups.com
> >> For more options, visit this group at
> >> http://groups.google.com/group/nodejs?hl=en?hl=en
> >
> >
> > --
> > Job Board: http://jobs.nodejs.org/
> > Posting guidelines:
> > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> > You received this message because you are subscribed to the Google
> > Groups "nodejs" group.
> > To post to this group, send email to nodejs@googlegroups.com
> > To unsubscribe from this group, send email to
> > nodejs+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/nodejs?hl=en?hl=en
>
>
>
> --
> Oliver Leics @ G+
> https://plus.google.com/112912441146721682527
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Streaming asynchronous template engine

2012-05-30 Thread Oliver Leics
@Tim: Does Kernel stream the output while rendering?

On Wed, May 30, 2012 at 4:50 PM, Tim Caswell  wrote:
> Corn is unmaintained, but the replacement it https://github.com/c9/kernel
>
> Kernel is extremely simple, but powerful through helper functions that
> accept blocks.  Even though the language doesn't have conditionals or loops,
> they are easy to implement as helpers.
>
> In nodebits.org, I use kernel.  I have helpers that do things like "Make a
> database query and loop over the results using the block as a template"
>  It's great!
>
>
> On Wed, May 30, 2012 at 7:19 AM, Arnout Kazemier  wrote:
>>
>> https://github.com/creationix/corn ?
>>
>> On Wednesday, May 30, 2012 at 2:15 PM, Oliver Leics wrote:
>>
>> Hallo,
>>
>> is dustjs[1] really the only template engine that implements rt
>> streamed render output and supports asynchronous calls within
>> template-functions?
>>
>> [1] https://github.com/akdubya/dustjs
>>
>> --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines:
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to nodejs@googlegroups.com
>> To unsubscribe from this group, send email to
>> nodejs+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>
>>
>> --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines:
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to nodejs@googlegroups.com
>> To unsubscribe from this group, send email to
>> nodejs+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en



-- 
Oliver Leics @ G+
https://plus.google.com/112912441146721682527

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Streaming asynchronous template engine

2012-05-30 Thread Tim Caswell
Corn is unmaintained, but the replacement it https://github.com/c9/kernel

Kernel is extremely simple, but powerful through helper functions that
accept blocks.  Even though the language doesn't have conditionals or
loops, they are easy to implement as helpers.

In nodebits.org, I use kernel.  I have helpers that do things like "Make a
database query and loop over the results using the block as a template"
 It's great!

On Wed, May 30, 2012 at 7:19 AM, Arnout Kazemier  wrote:

> https://github.com/creationix/corn ?
>
> On Wednesday, May 30, 2012 at 2:15 PM, Oliver Leics wrote:
>
> Hallo,
>
> is dustjs[1] really the only template engine that implements rt
> streamed render output and supports asynchronous calls within
> template-functions?
>
> [1] https://github.com/akdubya/dustjs
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>
>
>  --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Callback Style Preference

2012-05-30 Thread Tim Caswell
The most correct value for the error parameter is "undefined", but most of
us are lazy and type "null" instead.  In most code it expects the err
parameter to be either falsy or an Error instance, so it doesn't matter if
you use false, undefined, null, 0, or even "".

While there are some functions that never emit an error, if there is any
chance they would emit one in the future, save yourself the trouble and
reserve the err parameter.  Also it makes the function work with
flow-control tools and wrappers that assume the pattern.

On Wed, May 30, 2012 at 4:05 AM, Mariusz Nowak  wrote:

> It should be null or undefined only, everything else is a value, and can
> mistakenly accepted as an error.
>
> There are however asynchronous functions that never resolve with an error
> (e.g. path.exists) and as there's no point in always sending null to their
> callbacks, they're designed to pass success value as first argument (in
> case of path.exists true or false).
>
> --
> Mariusz Nowak - @medikoo
>
>
> On Wednesday, May 30, 2012 3:24:06 AM UTC+2, Daniel R. wrote:
>>
>> Is there consensus on the value to pass to a callback if there isn't
>> an error and there may or may not be a resulting value. A quick survey
>> of node.js code along with popular modules seems to indicate that null
>> is most common but undefined and false also pop up frequently. While
>> any falsey value works I was curious if one was preferred.
>>
>> -- Daniel R.  [http://danielr.neophi.com/]
>>
>  --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Katana - MVC/HMVC framework for any Node.js samurai.

2012-05-30 Thread Shogun
вторник, 29 мая 2012 г., 23:48:15 UTC+3 пользователь EllisGL написал:
>
> Just wanted to say, so far it looks good. Was wondering if you are going 
> to do a tutorial. Something like a guest book with a DB backend, sessions / 
> cookies, and something showing integration with socket.io.
>

Hi EllisGL, for sure i will write some tutorial, soon.

Thanks Bernardo. ;)

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: database initialization pattern?

2012-05-30 Thread Ben Kelly
I spoke with the author.  The node-db-migrate package supports mysql,
postgres, and sqlite at the moment.  The underlying database drivers are
not automatically pulled in as dependencies, though, so that you are not
forced to install all of these.  You need to install the appropriate
underlying driver yourself.

Right now node-db-migrate is specific to relational databases.

Hope that helps.

Ben

On Wed, May 30, 2012 at 1:35 AM, deitch  wrote:

> That looks interesting. It seems modeled on db:migrate. I like how it
> keeps track of the various migrations and versionizes the whole thing.
>
> I don't understand how it gets drivers structured, or how it would
> work with nosql databases, but conceptually, it definitely does the
> right thing.
>
> Thanks!
>
> On May 29, 8:59 pm, Ben Kelly  wrote:
> > On Tue, May 29, 2012 at 1:40 PM, deitch  wrote:
> > > a) Is there anything like "rake db:migrate" from Rails for node?
> >
> > One of my coworkers wrote a migration lib for node:
> >
> >  https://github.com/nearinfinity/node-db-migrate
> >
> > Hope that helps.
> >
> > Ben
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Streaming asynchronous template engine

2012-05-30 Thread Pedro Teixeira
There is substack's node-trumpet: https://github.com/substack/node-trumpet
This one uses css selectors for replacements.

I use a modified version of this one in woosh.

btw, woosh is unfinished.

On Wednesday, May 30, 2012 1:15:46 PM UTC+1, Oliver Leics wrote:
>
> Hallo, 
>
> is dustjs[1] really the only template engine that implements rt 
> streamed render output and supports asynchronous calls within 
> template-functions? 
>
> [1] https://github.com/akdubya/dustjs 
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Streaming asynchronous template engine

2012-05-30 Thread Oleg Efimov (Sannis)
https://github.com/linkedin/dustjs is more fresh version :)

среда, 30 мая 2012 г., 16:15:46 UTC+4 пользователь Oliver Leics написал:
>
> Hallo, 
>
> is dustjs[1] really the only template engine that implements rt 
> streamed render output and supports asynchronous calls within 
> template-functions? 
>
> [1] https://github.com/akdubya/dustjs 
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: listen EADDRNOTAVAIL error in Node.js

2012-05-30 Thread Ben Noordhuis
On Wed, May 30, 2012 at 4:51 AM, thuan le minh  wrote:
> Yes Ben !
> here is my nginx configuration file :
> server {
>  listen 0.0.0.0:86;
>  server_name bongda.com.vn;
>  access_log /var/log/nginx/yourdomain.log;
> 
>  location / {
>        # The IP(s) on which your node server is running , I chose the
> port 3000
>        proxy_pass      http://127.0.0.1:3001;
>        proxy_set_header X-Real-IP      $remote_addr;
>        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
>        proxy_set_header Host           $http_host;
>        proxy_set_header X-NginX-Proxy  true;
>        proxy_redirect off;
>  }
>
> ...
> and about node.js file :
> var http = require('http');
>
> http.createServer(function(req, res){
>        res.writeHead(200, {'Conten-type': 'text/plain'});
>        res.end(' ');
> }).listen(3001, "127.0.0.1");

Looks okay to me, nothing that's obviously wrong (except that
Content-Type is spelt wrong but that's inconsequential). What does
`strace node yourapp.js` print?

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: recommended flow control library?

2012-05-30 Thread José F . Romaniello
+1 fix the language. I think IcedCoffeeScript is a great thing, and very 
easy to use but i know most of people will disagree, thats the reason is 
not in coffee main repo. 

On Tuesday, May 29, 2012 5:02:41 PM UTC-3, Bruno Jouhier wrote:
>
> My take about it: flow control is not (or should not be) a library issue. 
> It is a language issue. 
>
> The language has all the keywords that you need to do flow control (if, 
> else, return, while, for, break, continue, throw, try, catch, finally, 
> ). These keywords let you express complex flow control very efficiently 
> and elegantly, as long as you deal with sync code flows. If you can fix the 
> language and restore the power of these keywords so that they can deal with 
> both sync and async code flows then you win: no new API to learn, no extra 
> noise, just simple and familiar JS code.
>
> You also need a simple trick (with minimal syntax overhead) to parallelize 
> stuff and express workflows but that's easy once you have fixed the 
> language.
>
> Bruno
>
>
> On Saturday, May 26, 2012 8:54:13 PM UTC+2, Davis Ford wrote:
>>
>> There does not appear to be a shortage of libraries out there that help 
>> with flow control.  I'm looking for something that is well tested, 
>> maintained, and has the capability to deal with parallel and sequential 
>> workflows - functional programming syntactic sugar is a plus...don't care 
>> about coffeescript, and documentation that is in coffeescript only is a 
>> minus.
>>
>> https://github.com/joyent/node/wiki/modules#wiki-async-flow 
>>
>> I've been browsing a lot of these on github, and a number of them look 
>> good, but it is quite time consuming to investigate them all, so I'd love 
>> to hear any feedback from the group.  Are you using any of these (or other 
>> libs not listed) -- happy with them?  Any you would recommend?
>>
>> Thanks in advance,
>> Davis
>>
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Streaming asynchronous template engine

2012-05-30 Thread Oliver Leics
On Wed, May 30, 2012 at 2:22 PM, Nuno Job  wrote:
> https://github.com/pgte/woosh

Looks good on first sight, I'll give it a try.



Anything else?

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Streaming asynchronous template engine

2012-05-30 Thread Oliver Leics
On Wed, May 30, 2012 at 2:19 PM, Arnout Kazemier  wrote:
> https://github.com/creationix/corn ?

Doesn't stream the render-output, does it?

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Streaming asynchronous template engine

2012-05-30 Thread Nuno Job
Pedro was working on this:

https://github.com/pgte/woosh

Nuno

On Wed, May 30, 2012 at 1:15 PM, Oliver Leics wrote:

> Hallo,
>
> is dustjs[1] really the only template engine that implements rt
> streamed render output and supports asynchronous calls within
> template-functions?
>
> [1] https://github.com/akdubya/dustjs
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Streaming asynchronous template engine

2012-05-30 Thread Arnout Kazemier
https://github.com/creationix/corn ?

On Wednesday, May 30, 2012 at 2:15 PM, Oliver Leics wrote:

> Hallo,
> 
> is dustjs[1] really the only template engine that implements rt
> streamed render output and supports asynchronous calls within
> template-functions?
> 
> [1] https://github.com/akdubya/dustjs
> 
> -- 
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com 
> (mailto:nodejs@googlegroups.com)
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com 
> (mailto:nodejs+unsubscr...@googlegroups.com)
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
> 
> 


-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Streaming asynchronous template engine

2012-05-30 Thread Oliver Leics
Hallo,

is dustjs[1] really the only template engine that implements rt
streamed render output and supports asynchronous calls within
template-functions?

[1] https://github.com/akdubya/dustjs

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Best practices for sharing code and data between the server and client

2012-05-30 Thread Amjad
Hello everybody!

I'm new to the great world of Node.js and have been playing around with
different modules and frameworks. However, there seems a lot of methods for
sharing server code with the client, and there are no default way for doing
that.

I have come across many ideas:

express-expose: this is a nice replacement for parsing JSON objects
rendered by the the server.
https://github.com/visionmedia/express-expose

This article exposes a hack to share backbone models on the Node server,
and they are trying to neat their hack with their Capsule and Thoonk
frameworks:
http://andyet.net/blog/2011/feb/15/re-using-backbonejs-models-on-the-server-with-node/

Syncrhonizing Backbone model using socket.io
https://github.com/scttnlsn/backbone.io

DNode and RPC as a method to use server methods on the client and vice versa
https://github.com/substack/dnode

I know I've mixed a lot of topics, I thought sharing my confusion would
help to get more clarification, especially that there are a lot of
production projects based on Node, andI think that the community certainly
have reached a good collection of concepts and tools for sharing code
between the server and client. I would be very grateful for sharing your
thoughts about that.

Best regards,

Amjad

*
*

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Callback Style Preference

2012-05-30 Thread Mariusz Nowak
It should be null or undefined only, everything else is a value, and can 
mistakenly accepted as an error.

There are however asynchronous functions that never resolve with an error 
(e.g. path.exists) and as there's no point in always sending null to their 
callbacks, they're designed to pass success value as first argument (in 
case of path.exists true or false).

-- 
Mariusz Nowak - @medikoo


On Wednesday, May 30, 2012 3:24:06 AM UTC+2, Daniel R. wrote:
>
> Is there consensus on the value to pass to a callback if there isn't 
> an error and there may or may not be a resulting value. A quick survey 
> of node.js code along with popular modules seems to indicate that null 
> is most common but undefined and false also pop up frequently. While 
> any falsey value works I was curious if one was preferred. 
>
> -- Daniel R.  [http://danielr.neophi.com/] 
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs][ANN] siege.js by kissjs.org publish 0.0.2

2012-05-30 Thread jason . 桂林
I forgot add an example for it.

siege()
.host('localhost')
.on(3000)
.get('/')
.attack();

2012/5/29 Osher El-Netanany 

> What can we do to add the ability to siege an external server?
> I mean - instead of providing app.js - I want to provide a base URL to an
> exteranal server.
>
> Do you think it is simple to add? :)
>
> On Sun, May 6, 2012 at 7:04 PM, jason.桂林  wrote:
>
>> siege.js is a http benchmark module.
>>
>> features:
>>
>> * benchmark with keep alive connection, (useful on mac os)
>> * colorful report
>> * multiple task define
>> * cookie support (>= 0.0.2)
>>
>> example:
>>
>> siege()
>>>   .on(3000)
>>>   .for(1).times
>>>   .get('/')
>>>   .attack()
>>
>>
>> for a nodejs app.js, which module.exports = function(req, res), you can
>> use siege start your server, before benchmark, and close server after
>> benchmark.
>>
>> siege(__dirname + '/app.js')
>>>   .on(4000)
>>>   .withCookie
>>>   .for(1).times
>>>   .concurrent(100)
>>>   .get('/set-cookie')
>>>   .get('/get-cookie')
>>>   .get('/').withoutCookie
>>>   .attack()
>>
>>
>> enjoy it.
>>
>> by kissjs.org.
>>
>> We are looking for collaborators.
>> --
>> Best regards,
>>
>> 桂林 (Gui Lin)
>>
>> guileen@twitter
>> 桂林-V@weibo 
>> guileen@github 
>>
>>  --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines:
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to nodejs@googlegroups.com
>> To unsubscribe from this group, send email to
>> nodejs+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>
>
>  --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>



-- 
Best regards,

桂林 (Gui Lin)

guileen@twitter 
桂糊涂@weibo 
guileen@github 

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en