[nodejs] Re: looking for a ORM framework with redis

2012-10-31 Thread José F . Romaniello
technically speaking "an ORM for redis" is incorrect at least. ORM means 
Object to Relational mapping and redis is not relational.

Usually an ORM deals with things like mapping an object model and its 
relationship (like a composition, inheritance, collections of objects and 
values, etc) to a relational model with rows, columns, FKs and no more to 
solve the so called "Object-relational impedance mismatch" 
http://en.wikipedia.org/wiki/Object-relational_impedance_mismatch. 

Maybe you are looking for something like an OKVM: "Object Key-Value 
Mapping", which i am not sure if it exist. 

Could you expand a little bit more about the problem you are trying to 
solve?

On Tuesday, October 30, 2012 12:50:15 AM UTC-3, Angelo Chen wrote:
>
> Hi,
>
> have used Redis in a project, now like to save time by using an ORM for 
> redis in another project, any suggestions? thanks.
>
> Angelo
>

-- 
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: Simple LightWeight OOP. 100% compatibility with JavaScript. Feedback please!

2012-11-06 Thread José F . Romaniello
I really like this functional mixins thing, another good read is this one

http://killdream.github.com/blog/2011/10/understanding-javascript-oop/

-- 
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] PaaS that allows node.js to use non-http ports?

2012-11-06 Thread José F . Romaniello
I was working on something similar and asked nodejitsu, they dont support raw 
Tcp ports yet.


I did a research for my project and there isnt any with this, you might have to 
use a vm

-- 
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: Node.js for OData SDK

2012-11-27 Thread José F . Romaniello
We have been working on an odata parser:

https://github.com/qraftlabs/node-odata-parser

we used this to creata a proxy to singly.com social APIs

I'd like to see a translation between the odata expression tree to mongodb 
query documents :)

On Tuesday, November 27, 2012 4:00:39 AM UTC-3, Luke Han wrote:
>
> Hi experts,
> As following link mentioned: http://www.odata.org/libraries
> Node.js library is listing on Server side tech deck, but after I go 
> through datajs & jaydata, there's nothing mentioned about how to create 
> odata producer for server side. almost is about how to consume OData.
>  Do we have some project to support this?
>  Thank you very much.
>
> Luke
>

-- 
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] Debugging with node.js

2012-11-29 Thread José F . Romaniello
if you are running this on windows 0.0.0.0 doesnt exist there.. you should
use 127.0.0.1 or localhost


2012/11/29 Dave Johnson 

> Hello,
>
> I am trying to debug a very simple app in node.js and I am having problems.
>
> Here are my stages:
>
> *1. In node.js console:*
> npm install -g node-inspector
>
> *2. In app.js:*
> var foo = function(){
>   var a = 3, b = 5;
>   debugger;
>   var bar = function() {
> var b = 7, c = 11;
> a += b + c;
> debugger;
>   }
>   bar ();
>   debugger;
> };
> foo();
>
> *3. In node.js console:*
> node --debug-brk app.js
>
> Response: debugger listening on port 5858
>
> *4. In another node.js console:*
> node-inspector
>
> Response:
> info  - socket.io started
> visit http://0.0.0.0:8080/debug?port=5858 to start debugging
>
>
> However if I browse to 
> *http://0.0.0.0:8080/debug?port=5858* I
> just get:
>
> This webpage is not available
> The webpage at *http://0.0.0.0:8080/debug?port=5858* might be temporarily
> down or it may have moved permanently to a new web address.
> Error 108 (net::ERR_ADDRESS_INVALID): Unknown error.
> Any ideas where I am going wrong here?
> Thanks, Dave J.
>
>
> --
> 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] about node js

2012-12-04 Thread José F . Romaniello
it seems you hardcoded the ip address and it is unlikely you have same ip
in the two machines.


2012/12/4 atul kanekar 

> Hi..
>Atul here ...i have install node on local and server (on ubuntu).On
> local it is working fine..with any port..But it is not working on
> server...So please help me out ...i am sending here code...as follows :
>
> 1.hello.js
>
> var http = require('http');
> http.createServer(function (req, res) {
>   res.writeHead(200, {'Content-Type': 'text/plain'});
>   res.end('Hello Node.js\n');
> }).listen(5190,"124.153.76.232");
>
> 2. node hello.js
>
> 3. and accessing on as 124.153.76.232:5190
>
> But i am getting here error i am unable to get solution...please help me...
>
>
> Thanks..
>
>  --
> 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] "this" and that

2012-12-11 Thread José F . Romaniello
I agree with Brett, but Id like to add something to this:

2012/12/11 spqr 

> Sure, I worked around it by getting a reference to the object I really
> want and passing it in to the
> function as an argument (annoying and ugly, but workable).
>


met 
Function.prototype.bind.
You can basically use it as follows:

function sayHello() {
  console.log('hello', this);
}
var helloFoo = sayHello.bind({foo: 'bar'});

helloFoo(); //will printhello {foo: 'bar'}

-- 
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] "this" and that

2012-12-11 Thread José F . Romaniello
It is not clear for me why you use eval in this example, please excuse me
if I mention very basic things for you not trying to insult nor judging
your 25 years as a developer, after all you can be new to js as I were few
months ago. I took the time to make this clear because you seem a little
bit susceptible in your responses in this thread. So help me undestand your
scenario and maybe we can both win

Why you do this:

var myobj = require( the-file );
eval( 'myobjs.' + file-name = myobj;');

Instead of:

myobjs[file-name] = require( the-file );


So then you can do

myobjs.filename.initialize()

I have seen this pattern quite a lot in node.js modules

El martes, 11 de diciembre de 2012, spqr escribió:

>
> Thanks for the thoughtful response.  My question was a bit "tongue in
> cheek."  I'm an experienced programmer and
> I've worked with a lot of languages and environments for over 25 years.  I
> started out my post saying that I was working
> on a program that is fairly unusual because the system I'm building is
> creating objects with code that gets executed
> and the loading and unloading of the modules is managed by the master
> program.
>
> I ran across "bind" and thought it might be a solution, but I hadn't
> experimented with it yet.
>
> In more detail, my scenario is this:
>
> Master program:
>
> Reads a directory containing JavaScript looping through each one and doing
> this:
>
> var myobj = require( the-file );
> eval( 'myobjs.' + file-name = myobj;');
>
> So, now I have an object 'myobjs' that has a reference to each object I've
> loaded.
>
> each file I'm loading looks something like this:
>
> module.exports = {
>   data1: "blah",
>   data2: "blah",
>   initialize: function(ctx, self) {
> //your code here that can't access data1
> or data2 without self  :-)
> }
> };
>
> When I want to run one of the myobj.initialize functions, I'm currently
> doing this:
>
> var self = eval(myobjs.filename);
> eval(myobjs.filename.initialize)(myctx, self);
>
> This solution appears to work.
>
> On Tuesday, December 11, 2012 5:10:19 PM UTC-5, José F. Romaniello wrote:
>>
>> I agree with Brett, but Id like to add something to this:
>>
>> 2012/12/11 spqr 
>>
>>> Sure, I worked around it by getting a reference to the object I really
>>> want and passing it in to the
>>> function as an argument (annoying and ugly, but workable).
>>>
>>
>>
>> met 
>> Function.prototype.bind<https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function/bind>.
>> You can basically use it as follows:
>>
>> function sayHello() {
>>   console.log('hello', this);
>> }
>> var helloFoo = sayHello.bind({foo: 'bar'});
>>
>> helloFoo(); //will printhello {foo: 'bar'}
>>
>>   --
> 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  'nodejs%2bunsubscr...@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] "this" and that

2012-12-11 Thread José F . Romaniello
Object keys are always strings (or converted to string) you can reference
it with dot or with square brakets and string...

foo.bar

does the same than

foo["bar"]

always, but you can do also

var thekey = "key";
foo[thekey]...

Some useful methods:

thekey in foo // will return true if foo has a property named thekey
Object.keys(foo) // returns an array of string with all enumerable
properties


El miércoles, 12 de diciembre de 2012, spqr escribió:

>
> Thanks for your help on this, I think you solved my problem with "this" by
> helping me avoid eval().
> Coming at JavaScript with some history in lisp, maybe my question should
> have been "why does JavaScript have eval()?" ;-)
> (Hah! I know it still has its uses...)
>
> I just constructed this code:
>
> var myobjs = { p1234: { a: 1,
>b: function() { var c = this.a; return 0; }},
>   p2345: { a: 2,
>b: function() { var c = this.a; return 1; }}};
>
> var q = "p1234";
> myobjs[q].b();
>
> I ran a quick test and it works like a charm.  I noticed that the object
> keys can be
> literals or strings and it still works.  Is there any preference on which
> to use?
>
> --
> 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  'nodejs%2bunsubscr...@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] "this" and that

2012-12-11 Thread José F . Romaniello
If you use the brakets notation you can use all kind of weird things loke
spaces, dashes, slash etc

foo["bar lala / oia"] = 12345;

But you will be never able to call this with dot notation

El miércoles, 12 de diciembre de 2012, José F. Romaniello escribió:

> Object keys are always strings (or converted to string) you can reference
> it with dot or with square brakets and string...
>
> foo.bar
>
> does the same than
>
> foo["bar"]
>
> always, but you can do also
>
> var thekey = "key";
> foo[thekey]...
>
> Some useful methods:
>
> thekey in foo // will return true if foo has a property named thekey
> Object.keys(foo) // returns an array of string with all enumerable
> properties
>
>
> El miércoles, 12 de diciembre de 2012, spqr escribió:
>
>>
>> Thanks for your help on this, I think you solved my problem with "this"
>> by helping me avoid eval().
>> Coming at JavaScript with some history in lisp, maybe my question should
>> have been "why does JavaScript have eval()?" ;-)
>> (Hah! I know it still has its uses...)
>>
>> I just constructed this code:
>>
>> var myobjs = { p1234: { a: 1,
>>b: function() { var c = this.a; return 0; }},
>>   p2345: { a: 2,
>>b: function() { var c = this.a; return 1; }}};
>>
>> var q = "p1234";
>> myobjs[q].b();
>>
>> I ran a quick test and it works like a charm.  I noticed that the object
>> keys can be
>> literals or strings and it still works.  Is there any preference on which
>> to use?
>>
>> --
>> 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] "this" and that

2012-12-12 Thread José F . Romaniello
jquery and also JSON2 uses eval as fallback mechanism when the browser
doesnt support JSON.parse, seems like a legit use case :)


2012/12/12 Rick Waldron 

>
>
>
> On Wed, Dec 12, 2012 at 2:17 AM, Isaac Schlueter  wrote:
>
>> On Tue, Dec 11, 2012 at 7:18 PM, spqr  wrote:
>> > maybe my question should have been "why does JavaScript have eval()?"
>> ;-)
>>
>> I think a lot of people have wondered the same thing.
>>
>> Yes, it has its uses, but at this point, I don't know of any that
>> aren't better served using some other mechanism.  eval() has weird
>> optimization-destroying semantics that cannot ever be changed, due to
>> the fact that JavaScript must be backwards compatible forever.
>>
>
>
> Runtime code generation? new Function( thecode ) works just as well, I
> guess
>
> Rick
>
>  --
> 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] How can I distribute my own node.js module using npm?

2012-12-17 Thread José F . Romaniello
You need a package.json, and then you can do npm publish.

https://npmjs.org/doc/json.html

A handy way to write the json file is to start with: npm init this will ask
you some question and then generate a package.json file for you.

BTW, in node.js modules are installed locally by default, so there is no
need to use "sudo" with npm install. In some system to install modules
globally you will need it, for instance sudo npm install -g 


2012/12/16 Andy Green 

> Is there any way to distribute node.js modules using npm? If I created a
> .js file called my-custom-module.js, how could I allow other users to
> install it using the command "sudo npm install my-custom-module"?
>
> --
> 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] Xcode and Node.js

2012-12-20 Thread José F . Romaniello
Sublime Text 2 has a "build system" property for projects two.. i tried
once, but it didnt work for me. I use sublime for writing the code and
terminal to run/test/commit/publish/link/etc


2012/12/20 Ryan Schmidt 

>
> On Dec 20, 2012, at 08:54, Rodrigo Fonseca wrote:
>
> > I'm using Text Mate, i try to use netbeans, but the files that end with:
> "html.ejs" were deconfigured, so i'm using text mate. So Xcode compile the
> node?? What this means?? That i don't need to use the Terminal to simulate
> a server?
>
> JavaScript is interpreted, not compiled. I didn't say Xcode integrated
> with Node in any way or that you could run your program from there, just
> that you can write JavaScript in Xcode's editor if you like. It might be
> possible to tell Xcode or another editor to run your JavaScript code for
> you, but I don't know how to do that. I just use TextMate to write my code,
> and Terminal to run 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
>

-- 
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] Is it possible to use classic ASP components with nodejs?

2012-12-25 Thread José F . Romaniello
Short answer no.

Long answer you could write a native module, using c++ or maybe c++/cli to
interact with the COM component. I wrote a blogpost about it
http://joseoncode.com/2012/04/10/writing-your-first-native-module-for-node-dot-js-on-windows/

But it is not that easy and requires a some effort. If you just need to
send mails, there are a lot of modules to do that on npm.
IMHO the ecosystem of libraries in node.js is biger than ASP3, just try npm
search mail.
Almost  everything is opensource, and you will find the documentation in
the github page for the project.

El martes, 25 de diciembre de 2012, Umut Muhaddisoglu escribió:

> Is there a way to use any classic ASP components (like
> http://www.aspemail.com/) with nodejs?
>
> I'm running nodejs on a Windows machine, need to run ping command
> concurrently and forking new ping processes is pretty expensive.
>
> As there are classic ASP components making ping requests using raw
> sockets, they can help me.
>
> Any way to do that?
>
> Thanks.
>
>
>  --
> 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  'nodejs%2bunsubscr...@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] Load Html file.

2012-12-26 Thread José F . Romaniello
You can use 
readFileSync

var http = require('http'),
fs = require('fs');
var html = fs.readFileSync('./index.html');

http.createServer(function(request, response) {
response.writeHeader(200, {"Content-Type": "text/html"});
response.write(html);
response.end();
}).listen(8000);



2012/12/26 Rodrigo Fonseca 

> Pedro,
>   Yes, it's done during app initialization, how can i do this?? I´m
> begginer with node, can you explain more details about it?
>
> Mark,
>  Ii want to do what Pedro said.
>
> cheers.
>
>
>>   --
> 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] Checking node_modules into git

2012-12-26 Thread José F . Romaniello
Hi all, I have read few times that is better to checking the dependencies
folder into git when you are working on a project that must be deployed, it
seems that this makes testing and maintainance easier. So, the advice seems
"be flexible with the dependencies for libraries, and very strict for
projects".

For me the pros are:
- dont have to blindly trust the correct use of semver from the package
owner
- make sure everyone has the same versions
- probabily faster to deploy, since npm install will do nothing

The bigger cons I see is that i dont like something in GIT that can be
auto-generated. It will happen almost for sure that someone will commit a
change in the package.json updating the version of the dependency and
forget about the node_modules or vicecersa. It will be easy to notice if it
breacks a test but not sure who wants to be dealing with that after all...

Thoughts? experiences?


Thanks!

-- 
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] require() MODULE_NOT_FOUND - yet it does exist

2012-12-26 Thread José F . Romaniello
How does module_file looks like? There are some rules, for instance,
if its in the same folder it should start with ./, like
require('./somefile')

2012/12/26, dar...@darrenwhitlen.com :
> Hi,
>
> Trying to simply require() in a .js file seems to be failing for me here,
> raising a MODULE_NOT_FOUND error.
> However - a fs.readFileSync() on the file does work.
>
> My current failing debug code:
> // Fails
> require(require('path').resolve(module_file));
>
> // Works
> require('fs').readFileSync(require('path').resolve(module_file), 'UTF8');
>
> Since the readFileSync() call works I can rule out any file/directory
> permissions leaving me with absolutely no ideas left as to why require()
> cannot find the file?
>
> Anyone have any debugging pointers to share?
>
> Darren
>
> --
> 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
>

-- 
Enviado desde mi dispositivo móvil

-- 
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] Checking node_modules into git

2012-12-27 Thread José F . Romaniello
Thank you all.. All these are very good points and I didnt know about
shrinkwrap! I will try it.


2012/12/27 Feross Aboukhadijeh 

> There was a blog post on the node.js blog comparing the npm-shrinkwrap and
> node_modules approaches:
>
>
> http://blog.nodejs.org/2012/02/27/managing-node-js-dependencies-with-shrinkwrap/
>
> Basically, checking node_modules into git works fine until you need to use
> a binary module, or a module with a binary dependency. You don't want to
> check in binary files if your server is on a different platform than your
> development environment. You can hack around it by adding rules to
> gitignore the binary files and running "npm rebuild" when you deploy, but
> npm-shrinkwrap is cleaner and simpler, in my opinion.
>
> Feross
>
>  If you check in the binary, then your code won't run  actually be
> checking in binary filesyou use a binary
>
>
> On Wednesday, December 26, 2012 8:59:11 PM UTC-8, Mikeal Rogers wrote:
>
>> I wrote an article about it a year ago, it's still relevant.
>>
>> http://www.mikealrogers.com/**posts/nodemodules-in-git.html<http://www.mikealrogers.com/posts/nodemodules-in-git.html>
>>
>> On Dec 26, 2012, at December 26, 20124:05 PM, José F. Romaniello <
>> jfroma...@gmail.com> wrote:
>>
>> Hi all, I have read few times that is better to checking the dependencies
>> folder into git when you are working on a project that must be deployed, it
>> seems that this makes testing and maintainance easier. So, the advice seems
>> "be flexible with the dependencies for libraries, and very strict for
>> projects".
>>
>> For me the pros are:
>> - dont have to blindly trust the correct use of semver from the package
>> owner
>> - make sure everyone has the same versions
>> - probabily faster to deploy, since npm install will do nothing
>>
>> The bigger cons I see is that i dont like something in GIT that can be
>> auto-generated. It will happen almost for sure that someone will commit a
>> change in the package.json updating the version of the dependency and
>> forget about the node_modules or vicecersa. It will be easy to notice if it
>> breacks a test but not sure who wants to be dealing with that after all...
>>
>> Thoughts? experiences?
>>
>>
>> Thanks!
>>
>> --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-**
>> 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 nod...@googlegroups.com
>>
>> To unsubscribe from this group, send email to
>> nodejs+un...@**googlegroups.com
>>
>> For more options, visit this group at
>> http://groups.google.com/**group/nodejs?hl=en?hl=en<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] How do you work with decimal numbers so that the precision problem of floats is under control?

2012-12-28 Thread José F . Romaniello
this a weakness of javascript, there is no decimal type. but as Kevin
pointed out there are several libraries.

One of the most complete I have seen so far is BigNumber (in npm is
bignumber.js):

https://github.com/MikeMcl/bignumber.js

I have never used though


2012/12/28 Kevin Purnelle 

> Hello,
>
> I am building my first app with nodeJS and I am very excited about
> everything I have been learning with nodejs until now.
> My concerns are about numbers, which can't be represented precisely with
> the current specs for floating point numbers in js (not only js, I know)
> In that application I have to handle money, so calculations and storage of
> these values must be error free.
>
> The app is built with AngularJS, nodeJS (with express) and Mongodb
>
> Could anybody indicates how to handle numbers: from the time when the user
> fills the form to the time when the value is stored into the database and
> then, presented again to the user?
>
> So far, I've read that people advise to store money values as integers
> (so, stored in cents) but I would like to know if somebody has already
> faced that problem and how it was solved.
>
> Thank you :)
>
> --
> 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] Inconsistent method names?

2012-12-28 Thread José F . Romaniello
I think underscore might have its place on the browser world where you cant
take for granted that things like Array.prototype.forEach/map/ exists. But
when i need these I usually go to mdn and copy/paste the compatibility
section. For Array.isArray:


if(!Array.isArray) {
  Array.isArray = function (vArg) {
return Object.prototype.toString.call(vArg) === "[object Array]";
  };
}

This give me an standard interface, not like _.isArray(..)


2012/12/28 Rick Waldron 

>
>
> On Friday, December 28, 2012, greelgorke wrote:
>
>> look further, there is more than just isArray. AND underscore falls back
>> to native implementations, if any present. and it's just it: same interface
>> for every plattform.
>
>
> Yes, I'm very aware of underscore, thank you. I don't believe in adding a
> full on library for the sake of using a single function that language
> already offers natively. Furthermore, underscore has a nasty history of not
> correctly matching native implementations, so lucky you: same API,
> different behaviour.
>
> The only platforms that don't support Array.isArray are old IEs.
>
>
> Rick
>
>
>
>> Am Freitag, 28. Dezember 2012 22:31:28 UTC+1 schrieb Rick Waldron:
>>
>>
>>
>> On Friday, December 28, 2012, greelgorke wrote:
>>
>> psst.. i heard underscore have some cool tools for the typeof pain, like
>> http://underscorejs.org/#**isArray 
>>
>>
>> *facepalm*
>>
>> Really? On a platform that supports Array.isArray built-in?
>>
>> Rick
>>
>>
>>
>> Am Donnerstag, 27. Dezember 2012 22:32:03 UTC+1 schrieb Mark Hahn:
>>
>> >  what sort of program scenarios you've found yourself in where
>> instanceof was the "go to" solution
>>
>> I use typeof a lot, but instanceof not so often.  I sometimes use
>> instanceof Array when I don't have a helper around for that.
>>
>> I've just started a module for use in node and the client that "fixes"
>> these as much as possible.  It is annoying when I get an error just
>> because of lack of camelCasing.  My mind isn't good at remembering
>> minor things.
>>
>> Does anyone know how I could fix typeof in node?  I can see how to do
>> it in the client.  Luckily I'm using coffeescript so making typeOf a
>> function will be used like `typeOf x` and it will look the same as
>> typeof `x`.
>>
>> > Completely irrelevant to the discussion...
>>
>> What is irrelevant?
>>
>> On Thu, Dec 27, 2012 at 1:06 PM, Rick Waldron 
>> wrote:
>> > Inline...
>> >
>> >
>> > On Thursday, December 27, 2012, Mark Hahn wrote:
>> >>
>> >> Why not also allow readDir?  It would cause no harm to do so.
>> >>
>> >> This isn't node, but what also bugs me is typeof and instanceof.  I
>> >> cringe every time I type them.
>> >
>> >
>> > Completely irrelevant to the discussion... but you have my attention
>> now—I'm
>> > curious to know what sort of program scenarios you've found yourself in
>> > where instanceof was the "go to" solution (but painful to use?), aside
>> from
>> > useful type checking (types as in "object types", not as in
>> "data-types").
>> > If you want to know if x has Foo constructor in its prototype chain,
>> > instanceof has you covered.
>> >
>> > Rick
>> >
>> >
>> >>
>> >>
>> >>
>> >> On Thu, Dec 27, 2012 at 11:47 AM, David Habereder
>> >>  wrote:
>> >> > That clears that up. Thanks.
>> >> >
>> >> > Am Donnerstag, 27. Dezember 2012 20:36:30 UTC+1 schrieb Matt
>> Sergeant:
>> >> >>
>> >> >> I think you'll likely find where it isn't the case (such as
>> readdir)
>> >> >> the
>> >> >> name comes from the POSIX function name. There's no readfile
>> function
>> >> >> in
>> >> >> POSIX, but there is readdir(). The only other case seems to be
>> >> >> readlink,
>> >> >> which is the same issue.
>> >> >>
>> >> >> http://linux.die.net/man/2/**rea**ddir
>> >> >> http://linux.die.net/man/2/**rea**dlink
>> >> >>
>> >> >>
>> >> >> On Thu, Dec 27, 2012 at 1:02 PM, David Habereder <
>> david.h...@gmail.com>
>> >> >> wrote:
>> >> >>>
>> >> >>> Hi,
>> >> >>>
>> >> >>> I am quite new to node.js.
>> >> >>>
>> >> >>> As far as I can see the method names aren't very consistent. Take
>> the
>> >> >>> methods from File System for example:
>> http://nodejs.org/api/fs.html
>> >> >>> It is ".readFile" (Camelcase)
>> >> >>> But it is ".readdir" (all lowercase)
>> >> >>>
>> >> >>> There are a few more such cases where I don't see a pattern when
>> >> >>> camelcase is used and when not.
>> >> >>>
>> >> >>> You could say that this is absolutely irrelevant and you would be
>> >> >>> right.
>> >> >>> But it annoys me :-(
>> >> >>> And it reminds me of PHP syntax garbage.
>> >> >>>
>> >> >>> Is there any interest in getting all method names either camelcase
>> or
>> >> >
>>
>>  --
> 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 thi

Re: [nodejs] Inconsistent method names?

2012-12-28 Thread José F . Romaniello
Two methods for doing the same thing!! Smells. I write code with a browser
besides my editor (actually in another screen) and I cant do a lot without
looking at node docs or the github page for the module I am using, even for
my own oss modules.

I am all for naming convention but this will not help you enough to not
have to look at the docs from time to time.

If it feels that disturbing for you, just create a new module fs2 with a
for each loop, copy the methods renaming the inconsistents, npm publish and
presto.

At least, as an advice, please dont write code like

var fs = require(fs2);

fs.readDir(..);

This will be disturbing, use fs2.readDir..

El viernes, 28 de diciembre de 2012, Phoscur escribió:

> What's the harm in adding this alias to node?
> I remember myself running into this (as not everyone knows posix calls by
> heart) and posting on this list.
>
> Am 27.12.2012 22:51, schrieb Isaac Schlueter:
>
>> On Thu, Dec 27, 2012 at 1:03 PM, Jonathan Chayce Dickinson
>>  wrote:
>>
>>> fs.prototype.readDir = function() { return fs.prototype.readdir.apply(**
>>> this,
>>> arguments); }
>>>
>> That's not going to work.  fs is an object, not a class.  I think what
>> you mean is `fs.readDir = fs.readdir`.
>>
>> We do keep our shit consistent.  Specifically, we keep our method
>> names consistent with the posix syscalls they invoke.
>>
>>
> --
> 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] Manually install module that isn't in NPM

2012-12-30 Thread José F . Romaniello
npm install gitrepostiroy#branch


2012/12/30 Kamil Krzyszczuk 

> Nuno, read posts. Socket.io 1.0 isn't present in NPM yet.
>
>
> 2012/12/30 Nuno Job 
>
>> Use npm.
>>
>> Nuno
>>
>> Sent from my iPhone
>>
>> On Dec 30, 2012, at 4:13 PM, hashi101  wrote:
>>
>> I try to install Socket.io 1.0,so I downloaded socket.io-1.0 and
>> socket.io-client-1.0 packages. And put it in node_modules folder. Changed
>> "socket.io-client" to "socket.io.client-1.0" in some files, because they
>> except the first name. And then I run sample application:
>>
>> var io = require('socket.io-1.0')(7001);
>>
>> io.on('connection', function(socket){
>>   socket.on('event', function(data){});
>>   socket.on('disconnect', function(){});
>> });
>>
>> output was full of not installed modules, so I installed them up, and
>> now, when I run code above, get this:
>>
>> io.on('connection', function(socket){
>>^
>> TypeError: Object # has no method 'on'
>> at Object. (/usr/home/user/programs/soc10/soc.js:3:4)
>> at Module._compile (module.js:449:26)
>> at Object.Module._extensions..js (module.js:467:10)
>> at Module.load (module.js:356:32)
>> at Function.Module._load (module.js:312:12)
>> at Module.runMain (module.js:492:10)
>> at process.startup.processNextTick.process._tickCallback
>> (node.js:244:9)
>>
>> it should work. What i've done wrong?
>>
>>  --
>> 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
>

-- 
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] Manually install module that isn't in NPM

2012-12-30 Thread José F . Romaniello
I told you: npm install git repository#branch

but you didnt put the branch name :)


2012/12/30 Kamil Krzyszczuk 

> Sry for my missunderstanding :) didn't know that there is official
> registry and options for others. So i tried it:
>
> npm install git://github.com/LearnBoost/socket.io.git
>
> but this installed just a 0.9.11 version. Maybe I copied wrong link, this
> is 1.0 branch:
> https://github.com/LearnBoost/socket.io/tree/1.0
>
> can someone look at it and say where is a link that should be to copied?
>
>
> 2012/12/30 Martin Cooper 
>
>>
>>
>> On Sun, Dec 30, 2012 at 8:55 AM, Kamil Krzyszczuk <
>> krzyszczukka...@gmail.com> wrote:
>>
>>> Nuno, read posts. Socket.io 1.0 isn't present in NPM yet.
>>>
>>
>> As I said in my previous post, you can use npm to install it from the
>> tarball. That is, "use npm", as Nuno said, or "npm install
>> gitrepostiroy#branch", as Jose said, are *not* the same as "install from
>> the registry". We understand you can't install from the registry. We're
>> trying to give you workable alternatives. :)
>>
>> --
>> Martin Cooper
>>
>>
>>
>>> 2012/12/30 Nuno Job 
>>>
 Use npm.

 Nuno

 Sent from my iPhone

 On Dec 30, 2012, at 4:13 PM, hashi101 
 wrote:

 I try to install Socket.io 1.0,so I downloaded socket.io-1.0 and
 socket.io-client-1.0 packages. And put it in node_modules folder. Changed
 "socket.io-client" to "socket.io.client-1.0" in some files, because they
 except the first name. And then I run sample application:

 var io = require('socket.io-1.0')(7001);

 io.on('connection', function(socket){
   socket.on('event', function(data){});
   socket.on('disconnect', function(){});
 });

 output was full of not installed modules, so I installed them up, and
 now, when I run code above, get this:

 io.on('connection', function(socket){
^
 TypeError: Object # has no method 'on'
 at Object. (/usr/home/user/programs/soc10/soc.js:3:4)
 at Module._compile (module.js:449:26)
 at Object.Module._extensions..js (module.js:467:10)
 at Module.load (module.js:356:32)
 at Function.Module._load (module.js:312:12)
 at Module.runMain (module.js:492:10)
 at process.startup.processNextTick.process._tickCallback
 (node.js:244:9)

 it should work. What i've done wrong?

  --
 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
>>>
>>
>>  --
>> 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-Po

Re: [nodejs] Aspect Oriented Programming in Node.js?

2013-01-03 Thread José F . Romaniello
I really like AOP in .net but I didnt have the need of AOP in javascript to
be honest.

About mixins, please have a look to this slide the part about Functional
Mixins

https://speakerdeck.com/anguscroll/how-we-learned-to-stop-worrying-and-love-javascript

This is very ubicuos and pure javascript.


2013/1/3 Amjad 

> For instance I've just read about mixins and they are related to the sort
> of problems AOP might deal with. I'm looking for more of such techniques.
> I'm also now reading about monkey patching Martin mentioned :-)
>
> Thank Steve for sharing the module you are working on. I'm learning about
> the concepts and the techniques you introduced.
>
>
> On Thu, Jan 3, 2013 at 4:17 PM, Amjad  wrote:
>
>> Thank you Angel for your quick and useful hint :)
>>
>> JavaScript is so flexible, that old problems has new solutions.
>>
>>
>> This is what I wanted to know really: does JS make us need 'serious' AOP?
>>
>> On Thu, Jan 3, 2013 at 4:11 PM, Angel Java Lopez 
>> wrote:
>>
>>> First idea: overwrite the .end method of response, in the object or in
>>> the prototype. Quick and dirty ;-)
>>>
>>> JavaScript is so flexible, that old problems has new solutions.
>>>
>>>
>>> On Thu, Jan 3, 2013 at 11:07 AM, Amjad  wrote:
>>>
 Thank you Martin. Well, I'm not really sure about specific use case
 since I'm new to AOP. I can think about middleware mechanism in Express and
 Connect, could it be considered some sort of AOP?

 I'm currently trying to build a social network consisting of several
 SPA. Problems araising from managing things such as authentication and
 logging, where you need to write the code for logging for example across
 several modules and files.

 For example, how can I log some information about a response *after *the
 response is actually delivered?


  --
>>> 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: How to revive a dead npm module?

2013-01-03 Thread José F . Romaniello
2013/1/1 Mark Hahn 

> God forbid that we run out of names.


We can always fallback to UUIDs!

npm install d7536be0-55e0-11e2-bcfd-0800200c9a66

-- 
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: comments in package.json

2013-01-07 Thread José F . Romaniello
prepublish is called for a local npm install too, but i think run before
not after.. This is inconvenient if you have the coffeescript compiler as a
local dependency

2013/1/7 Jacob Groundwater 

> Unless I am mistaken, `prepublish` is only called when doing `npm
> publish`, which you would never do for a web application.

-- 
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: comments in package.json

2013-01-07 Thread José F . Romaniello
mmh just tried and it doesnt work for me.. but i have proof i am not crazy

https://twitter.com/izs/status/284079077709729792


2013/1/7 José F. Romaniello 

> prepublish is called for a local npm install too, but i think run before
> not after.. This is inconvenient if you have the coffeescript compiler as a
> local dependency
>
>
> 2013/1/7 Jacob Groundwater 
>
>> Unless I am mistaken, `prepublish` is only called when doing `npm
>> publish`, which you would never do for a web application.
>
>
>

-- 
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] Anyone using domain-per-request with express?

2013-01-07 Thread José F . Romaniello
Hello, I am wondering if someone has an example of
domain-per-request
with express.

I have been testing with this project:

https://github.com/baryshev/connect-domain
https://github.com/baryshev/connect-domain/blob/master/lib/connect-domain.js

but if have few problems, first thing, I guess HttpResponse does not longer
emit the close event.

thanks.

-- 
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] Aplication restarter

2013-01-12 Thread José F . Romaniello
For windows I use nssm, I wrote this thing to make it easy to install node
apps

https://github.com/jfromaniello/winser

El sábado, 12 de enero de 2013, 犀利な天使 escribió:

> Unfortunately, "forever" not working on windows :(
> But i think it may be usefull with --watchDirectory argument and
> ".foreverignore" file in.
> And i hope this is also works:
> -c "node --harmony"
>
> Too many conditions..
>
> 2013/1/13 Faysal Banna  'degre...@gmail.com');>>
>
>> forever start -a -w app.js
>
>
>
>  --
> 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  'nodejs%2bunsubscr...@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] Aplication restarter

2013-01-12 Thread José F . Romaniello
I'd ask you the inverse, why would you reinvent the service function of
windows or *nix daemons in node? It's there, it is easy to use, the OS
comes with it. These things do a pretty good job starting the service when
booting, and trying to restart when it exist according the exit status.



2013/1/12 犀利な天使 

> What benefits in installing as service? That needs administrative rights,
> but this is too..
>
>
> 2013/1/13 José F. Romaniello 
>
> For windows I use nssm, I wrote this thing to make it easy to install
>> node apps
>>
>> https://github.com/jfromaniello/winser
>>
>> El sábado, 12 de enero de 2013, 犀利な天使 escribió:
>>
>>> Unfortunately, "forever" not working on windows :(
>>> But i think it may be usefull with --watchDirectory argument and
>>> ".foreverignore" file in.
>>> And i hope this is also works:
>>> -c "node --harmony"
>>>
>>> Too many conditions..
>>>
>>> 2013/1/13 Faysal Banna 
>>>
>>>> forever start -a -w app.js
>>>
>>>
>>>
>>>  --
>>> 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
>

-- 
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] Node.js and Google Drive, OAuth2

2013-01-13 Thread José F . Romaniello
Maybe you can use passport.js with google oauth2, ask for an access
token with 'offline ' so you can get a refresh token as well. I wrote
a module to autorefresh the tokens and i use it with a provisioning
client library i did, is on my github

2013/1/13, Angel Java Lopez :
> Hi people!
>
> I just browsing Google Drive SDK:
>
> Google Drive Developers
> https://developers.google.com/drive/
>
> There are many examples, in different technologies and languages. There is
> a JavaScript client example:
> https://developers.google.com/drive/quickstart-js
>
> But I want to use Google Drive like in .NET and other examples in DrEdit
>
> Dr.Edit
> https://developers.google.com/drive/examples/index
>
> For example, the .NET example is an ASP.NET MVC 3 application, where the
> client side makes the OAuth2 web dance ;-), AND THEN SERVER SIDE calls the
> google side so it can have access, TOO.
> https://developers.google.com/drive/examples/dotnet#authorizing_a_code_passed_from_the_google_drive_ui
> They are using a library from Google
> http://code.google.com/p/google-api-dotnet-client/
>
> There is a JavaScript client at:
> http://code.google.com/p/google-api-javascript-client/
> BUT ORIENTED TO browser client
>
> Any module, or at least, clues of implementing Node.js server side google
> library like .NET one?
> The only reference I found was:
> http://stackoverflow.com/questions/12131529/any-libraries-that-can-make-accessing-google-apis-as-a-service-account-simpler-f
>
> Angel "Java" Lopez
> @ajlopez
> github:ajlopez
>
> --
> 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
>

-- 
Enviado desde mi dispositivo móvil

-- 
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] Node.js and Google Drive, OAuth2

2013-01-13 Thread José F . Romaniello
https://github.com/jfromaniello/refresh-token
https://github.com/jfromaniello/gapps-provisioning

links


2013/1/13 José F. Romaniello 

> Maybe you can use passport.js with google oauth2, ask for an access
> token with 'offline ' so you can get a refresh token as well. I wrote
> a module to autorefresh the tokens and i use it with a provisioning
> client library i did, is on my github
>
> 2013/1/13, Angel Java Lopez :
> > Hi people!
> >
> > I just browsing Google Drive SDK:
> >
> > Google Drive Developers
> > https://developers.google.com/drive/
> >
> > There are many examples, in different technologies and languages. There
> is
> > a JavaScript client example:
> > https://developers.google.com/drive/quickstart-js
> >
> > But I want to use Google Drive like in .NET and other examples in DrEdit
> >
> > Dr.Edit
> > https://developers.google.com/drive/examples/index
> >
> > For example, the .NET example is an ASP.NET MVC 3 application, where the
> > client side makes the OAuth2 web dance ;-), AND THEN SERVER SIDE calls
> the
> > google side so it can have access, TOO.
> >
> https://developers.google.com/drive/examples/dotnet#authorizing_a_code_passed_from_the_google_drive_ui
> > They are using a library from Google
> > http://code.google.com/p/google-api-dotnet-client/
> >
> > There is a JavaScript client at:
> > http://code.google.com/p/google-api-javascript-client/
> > BUT ORIENTED TO browser client
> >
> > Any module, or at least, clues of implementing Node.js server side google
> > library like .NET one?
> > The only reference I found was:
> >
> http://stackoverflow.com/questions/12131529/any-libraries-that-can-make-accessing-google-apis-as-a-service-account-simpler-f
> >
> > Angel "Java" Lopez
> > @ajlopez
> > github:ajlopez
> >
> > --
> > 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
> >
>
> --
> Enviado desde mi dispositivo móvil
>

-- 
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] Node.js and Google Drive, OAuth2

2013-01-13 Thread José F . Romaniello
I suck at this thing, but the common oauth2 the flow is:

-user redirected to identity provider for authorization
google.com/blabla/cieintis=...&...redirect=
-redirected to application app.com/authcode=...
-the server side off app.com exchange "authcode + client id + client
secret" per access token

The access token is always meant to be used server side and it generally
expires. If you want to act on behalf of the user when he is offline you
need a refresh token that you will exchange for a new access token whenever
you need. The refresh token works until the user removes the authorization
for your application, and you can ask as many access token as you want even
if the last one has not expired.

Oauth 2 defines other exchanges, like sometimes you can exchange client
credentials per access token to act on behalf of the application. Google
doesnt support this AFAIK.

Eran Hammer, f*ck oauth2
http://hueniverse.com/2012/11/fuckoauth-realtimeconf/

El domingo, 13 de enero de 2013, Angel Java Lopez escribió:

> Thanks to @jfroma!
>
> Ah!, I see the query string should have a:
> access_type=offline
>
> The old trick of access_type=offline (Get Smart dixit ;-)
>
> That was my missing piece. I thought the code were for the online client,
> only.
>
> The rest of the message, is for my records and mind sanity, not Node.js
> related
>
> The other piece I misunderstood, it is the existence of a code at Dr.Edit
> .NET sample
>
> https://code.google.com/p/google-drive-sdk-samples/source/browse/dotnet/DrEdit/Models/Utils.cs
> ExchangeCode method uses:
>
> http://code.google.com/p/google-api-dotnet-client/source/browse/Src/GoogleApis.Authentication.OAuth2/DotNetOpenAuth/NativeApplicationClient.cs
> and then, the method ProcessUserAuthorization by DotNetOpenAuth, I guessed
> it was using something magic.
>
> Now, thanks to @jfroma response, I started to understand the server flow.
>
> Instead of using .NET code, I should have explore the Java example:
>
> http://code.google.com/p/google-api-java-client/source/browse/google-api-client/src/main/java/com/google/api/client/googleapis/auth/oauth2/GoogleAuthorizationCodeTokenRequest.java#80
> to understand the use of the code (retrieved in the first round to Google
> OAuth dance), to get the token to be used at server side.
>
> Angel "PissedByOAuth2TokenDanceAndNotTheFirstTime" Lopez ;-)
>
> On Sun, Jan 13, 2013 at 11:13 AM, José F. Romaniello <
> jfromanie...@gmail.com> wrote:
>
> https://github.com/jfromaniello/refresh-token
> https://github.com/jfromaniello/gapps-provisioning
>
> links
>
>
> 2013/1/13 José F. Romaniello 
>
> Maybe you can use passport.js with google oauth2, ask for an access
> token with 'offline ' so you can get a refresh token as well. I wrote
> a module to autorefresh the tokens and i use it with a provisioning
> client library i did, is on my github
>
> 2013/1/13, Angel Java Lopez :
> > Hi people!
> >
> > I just browsing Google Drive SDK:
> >
> > Google Drive Developers
> > https://developers.google.com/drive/
> >
> > There are many examples, in different technologies and languages. There
> is
> > a JavaScript client example:
> > https://developers.google.com/drive/quickstart-js
> >
> > But I want to use Google Drive like in .NET and other examples in DrEdit
> >
> > Dr.Edit
> > https://developers.google.com/drive/examples/index
> >
> > For example, the .NET example is an ASP.NET MVC 3 application, where the
> > client side makes the OAuth2 web dance ;-), AND THEN SERVER SIDE calls
> the
> > google side so it can have access, TOO.
> >
> https://developers.google.com/drive/examples/dotnet#authorizing_a_code_passed_from_the_google_drive_ui
> > They are using a library from Google
> > http://code.google.com/p/google-api-dotnet-client/
> >
> > There is a JavaScript client at:
> > http://code.google.com/p/google-api-javascript-client/
> > BUT ORIENTED TO browser client
> >
> > Any module, or at least, clues of implementing Node.js server side google
> > library like .NET one?
> > The only reference I found was:
> >
> http://stackoverflow.com/questions/12131529/any-libraries-that-can-make-accessing-google-apis-as-a-service-account-simpler-f
> >
> > Angel "Java" Lopez
> > @ajlopez
> > github:ajlopez
> >
> > --
> > 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

Re: [nodejs] [Idea]: npm as a dependancy injector.

2013-01-22 Thread José F . Romaniello
This doesnt work in practice because you might want to use different test
doubles for different tests, there are several ways to mock module
dependencies, on option is to use vm.runInNewContext

I did a module for this

https://github.com/jfromaniello/mockuire

it is like commonjs's require, but you can pass dependencies when you
require a module.

El domingo, 20 de enero de 2013, Athan Clark escribió:

> Hello everyone. I'd like to make unit testing a practice difficult to
> evade in Node.js. One of the requirements, though, is that you need to be
> able to test a module's functionality independently of it's dependencies
> (say that 10 times fast!). My idea is to make node more flexible in the
> directories it chooses to look for node modules by providing an alternative
> "mode" for it to look in - ie if *NODE_MODE* is set to "test", then npm
> will first try to look in ./test_node_modules for a package before looking
> in ./node_modules. That way we can provide *alternative *modules for a
> package - ie mock ones. Or if you were trying to make a package that was
> compatible with similar modules, you could have a 3rd party testing
> package, like a simple blog, that uses the similar package in one mode,
> then your package in another.
>
> Imagine being able to do a *`npm run-scripts test --deep`*, and then see
> each and every module complete a unit test before progressively walking up
> the dependance tree making scenario tests along the way. It makes my
> continuous integration senses salivate.
>
> What do you all think? Could someone could direct me to where/how npm /
> node implements `require();`? Where should I start?
>
> Thanks in advance!!
>
> --
> 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  'nodejs%2bunsubscr...@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: How can I hide node console window on Windows?

2013-01-25 Thread José F . Romaniello
what happen if you open a console and run "whoami"?

maybe is related to this issue:
https://github.com/jfromaniello/winser/issues/6



2013/1/25 -- -- 

> > winworker@0.0.0 install-windows-service C:\WINDOWS\nodejs
> > node_modules\.bin\winser -i
>
> You must run this tool as an administrator
>
> 
> i got this err
>
> when i run this on win server 2003
> i logon this server as an administrators group member
>
>
> 在 2012年6月3日星期日UTC+8上午10时37分02秒,José F. Romaniello写道:
>>
>> I did this, and works very fine for me:
>>
>> http://jfromaniello.github.**com/winser/<http://jfromaniello.github.com/winser/>
>>
>> Let me know if you need anything ar any feedback
>>
>> Cheers
>>
>>  --
> --
> 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: How can I hide node console window on Windows?

2013-01-25 Thread José F . Romaniello
Can you try this command and post the exact output? Thanks

whoami /groups

You should see something withh
S-1-5-32-544 Enabled Group

El viernes, 25 de enero de 2013, -- -- escribió:

> C:\Documents and Settings\php>net localgroup administrators php /add
> System error 1378 has occurred.
>
> The specified account name is already a member of the local group.
>
> 在 2013年1月26日星期六UTC+8上午6时02分57秒,José F. Romaniello写道:
>>
>> what happen if you open a console and run "whoami"?
>>
>> maybe is related to this issue:
>> https://github.com/**jfromaniello/winser/issues/6<https://github.com/jfromaniello/winser/issues/6>
>>
>>
>>
>> 2013/1/25 -- -- 
>>
>>> > winworker@0.0.0 install-windows-service C:\WINDOWS\nodejs
>>> > node_modules\.bin\winser -i
>>>
>>> You must run this tool as an administrator
>>>
>>> ==**==
>>> i got this err
>>>
>>> when i run this on win server 2003
>>> i logon this server as an administrators group member
>>>
>>>
>>> 在 2012年6月3日星期日UTC+8上午10时37分02秒,**José F. Romaniello写道:
>>>>
>>>> I did this, and works very fine for me:
>>>>
>>>> http://jfromaniello.github.**com**/winser/<http://jfromaniello.github.com/winser/>
>>>>
>>>> Let me know if you need anything ar any feedback
>>>>
>>>> Cheers
>>>>
>>>>  --
>>> --
>>> Job Board: http://jobs.nodejs.org/
>>> Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-*
>>> *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 nod...@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> nodejs+un...@**googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/**group/nodejs?hl=en?hl=en<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  'nodejs%2bunsubscr...@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: How can I hide node console window on Windows?

2013-01-26 Thread José F . Romaniello
It should work, since you have this line:

2013/1/26 -- -- 

> BUILTIN\AdministratorsAlias
>   S-1-5-32-544 Mandatory group, Enabled by default, Enabled
> group, Group owner


This is the check winser does:

https://github.com/jfromaniello/winser/blob/master/bin/winser#L55

whoami /groups | findstr /c:"S-1-5-32-544" | findstr /c:"Enabled group"

-- 
-- 
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] Precompiled 32- and 64-bit Windows binaries for node addons

2013-01-28 Thread José F . Romaniello
I do this for my windows-eventlog module

https://github.com/jfromaniello/windowseventlogjs

It is packaged with the two nodes files. I wish I have a build script for
this with node-gyp, haven't figure out yet, but shiping precompiled for
windows is a must, since I usually don't want to install dev tools on
servers.

El lunes, 28 de enero de 2013, Ben Noordhuis escribió:

> On Mon, Jan 28, 2013 at 9:33 AM, Zoid >
> wrote:
> > Hi all,
> >
> > I have 2 related questions:
> >
> > 1. Is there a way to put both 32-bit and 64-bit .node files under
> > node_modules so correct version is chosen based on which node is
> running. I
> > need both 32- and 64-bit node on the same system and would like to have
> > single local node_modules tree in my project instead of 2 mostly
> duplicate
> > trees.
>
> Something like this should work:
>
>   var foo = require('build/Release/foo.' + process.arch + '.node');
>
> Compile your module twice (or thrice, if you want to support ARM) to
> out/Release/foo.ia32.node and out/Release/foo.x64.node.
>
> It's possible that node-gyp has support for this built in.  Nathan?
>
> > 2. Is there a way to help module maintainers to include precompiled
> binaries
> > in their npm packages? Are binaries still supported? I'd like to start
> with
> > ws and xxhash - they both don't have binaries included at least for x64.
> >
> > Zoid
>
> You can ship .node files with a npm module and some modules do.  See
> the bson module for an example.
>
> --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com .
> For more options, visit https://groups.google.com/groups/opt_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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] [Idea]: npm as a dependancy injector.

2013-01-29 Thread José F . Romaniello
2013/1/22 Matt Walters 

> I built a nearly identical module with a nearly identical name. :P
>
> https://github.com/mateodelnorte/mockrequire
>
> 'npm install mockrequire' will get it.
>


Wow, I didn't see yours when i did mine, I had a look at your code and for
instance this wont work for me:

https://github.com/mateodelnorte/mockrequire/blob/master/index.js#L43

I use the "require" from the caller which is supposed to be at the same
level that the system under test. Another thing that I have to do in
mockuire is to copy globals to the vm

Mine still have some bugs, for instance i can't use __dirname or
__filename, not a biggy.

Having said that I have no problem to deprecate mine and contrib yours or
something alike

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] express app.set

2013-01-29 Thread José F . Romaniello
You can use 
fs.existsSyncbut
I have read in this list several times it is discouraged, what happen
if the file is deleted from disk *after* you ask if it exists and
*before*you require it.

You will be better with a try/catch.


2013/1/29 Norman Khine 

> i have this code:
>
> var blade = require('blade')
> ,express = require('express')
> ,http = require('http')
> ,https = require('https')
> ,fs = require('fs'),json;
>
> var GOOGLE_API_KEY = process.env.GOOGLE_API_KEY;
>
> var TABLE_ID = "1epTUiUlv5NQK5x4sgdy1K47ACDTpHH60hbng1qw";
> //var TABLE_ID ="1obpi0bmSDILX1cIQcVRNi1lUkm2K5xBFztmRFiM"
>
> var GOOGLE_PATH =
> "/fusiontables/v1/query?sql=SELECT%20*%20FROM%20"+TABLE_ID+"&key="+GOOGLE_API_KEY;
> var GOOGLE_DRIVE_PATH = "/drive/v2/files/"+TABLE_ID+"?key="+GOOGLE_API_KEY;
>
> var options = {
> hostname: 'www.googleapis.com'
> ,port: 443
> ,method: 'GET'
> };
>
> function TZMNetwork(fileId) {
> if (fs.existsSync("data/chapters.json")) {
> // ... put code if "data/chapters.json" has changed!
> console.log('OK');
> } else {
> options["path"] = GOOGLE_PATH;
>
> var file = fs.createWriteStream("data/chapters.json");
> var req = https.request(options, function(res) {
>   res.on('data', function(data) {
>   file.write(data);
>   }).on('end', function() {
>   file.end();
>   console.log("chapters.json created");
>   });
> });
> req.end();
>
> req.on('error', function(e) {
>   console.error(e);
> });
> }
> }
>
> var app = express();
> app.use(blade.middleware(__dirname + '/views') ); //for client-side
> templates
> app.use(express.favicon(__dirname + '/public/images/favicon.ico'));
> app.use(express.static(__dirname + '/public') ); //maybe we have some
> static files
> app.set('views', __dirname + '/views'); //tells Express where our views
> are stored
> app.set('translation', require(__dirname +
> '/public/locales/dev/translation.json'));
> app.set('chapters', require(__dirname + '/data/chapters.json'));
> app.set('view engine', 'blade'); //Yes! Blade works with Express out of
> the box!
> app.get('/', function(req, res, next) {
> TZMNetwork(TABLE_ID);
> res.render('index');
> });
> app.listen(29080);
> console.log('Server running at http://127.0.0.1:29080/');
>
>
> How would you ensure that if /data/chapters.json does not exists, for
> example when the app is run for the first time, the app.set('chapters',
> require(__dirname + '/data/chapters.json')); is by-passed?
>
> Is there a better way to do this?
>
> --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] express app.set

2013-01-29 Thread José F . Romaniello
I am not sure what you are trying to do, but I suppose this chapters.json
has an array of chapters.. and probabilly you are using this in one of your
routes and if the file doesn't exist it probabily means for you an empty
array.. So I am assuming a lot of things you haven't explained here, then
this might work for you:

try {
  app.set('chapters', require(__dirname + '/data/chapters.json'));
} catch(e) {
   console.log('there is no /data/chapters.json');
   app.set('chapters', []);
}






2013/1/29 Norman Khine 

>
>
> On Tuesday, January 29, 2013 7:12:45 PM UTC+1, Norman Khine wrote:
>>
>>
>>
>> On Tuesday, January 29, 2013 7:00:53 PM UTC+1, José F. Romaniello wrote:
>>>
>>> You can use 
>>> fs.existsSync<http://nodejs.org/api/fs.html#fs_fs_existssync_path>but I 
>>> have read in this list several times it is discouraged, what happen
>>> if the file is deleted from disk *after* you ask if it exists and *
>>> before* you require it.
>>>
>>
>> yes i changed to fs.existsSync
>>
>>>  You will be better with a try/catch.
>>>
>>
>> ok i understand, but how do i deal with the app.set('chapters',
>> require(__dirname + '/data/chapters.json')); if the file is not there in
>> the express route?
>>
>
> ok i got it
>
> app.set('translation', require(__dirname +
> '/public/locales/dev/translation.json'));
> try {
>   app.set('chapters', require(__dirname + '/data/chapters.json'));
> } catch(err) {
>   dumpError(err);
> }
>
> something like this?
>
>>
>>>
>>> 2013/1/29 Norman Khine 
>>>
>>>> i have this code:
>>>>
>>>> var blade = require('blade')
>>>> ,express = require('express')
>>>> ,http = require('http')
>>>> ,https = require('https')
>>>> ,fs = require('fs'),json;
>>>>
>>>> var GOOGLE_API_KEY = process.env.GOOGLE_API_KEY;
>>>>
>>>> var TABLE_ID = "**1epTUiUlv5NQK5x4sgdy1K47ACDTpH**H60hbng1qw";
>>>> //var TABLE_ID ="**1obpi0bmSDILX1cIQcVRNi1lUkm2K5**xBFztmRFiM"
>>>>
>>>> var GOOGLE_PATH = "/fusiontables/v1/query?sql=**
>>>> SELECT%20*%20FROM%20"+TABLE_**ID+"&key="+GOOGLE_API_KEY;
>>>> var GOOGLE_DRIVE_PATH = "/drive/v2/files/"+TABLE_ID+"?**
>>>> key="+GOOGLE_API_KEY;
>>>>
>>>> var options = {
>>>> hostname: 'www.googleapis.com'
>>>> ,port: 443
>>>> ,method: 'GET'
>>>> };
>>>>
>>>> function TZMNetwork(fileId) {
>>>> if (fs.existsSync("data/chapters.**json")) {
>>>> // ... put code if "data/chapters.json" has changed!
>>>> console.log('OK');
>>>> } else {
>>>> options["path"] = GOOGLE_PATH;
>>>>
>>>> var file = fs.createWriteStream("data/**chapters.json");
>>>> var req = https.request(options, function(res) {
>>>>   res.on('data', function(data) {
>>>>   file.write(data);
>>>>   }).on('end', function() {
>>>>   file.end();
>>>>   console.log("chapters.json created");
>>>>   });
>>>> });
>>>> req.end();
>>>>
>>>> req.on('error', function(e) {
>>>>   console.error(e);
>>>> });
>>>> }
>>>> }
>>>>
>>>> var app = express();
>>>> app.use(blade.middleware(__**dirname + '/views') ); //for client-side
>>>> templates
>>>> app.use(express.favicon(__**dirname + '/public/images/favicon.ico'))**;
>>>> app.use(express.static(__**dirname + '/public') ); //maybe we have
>>>> some static files
>>>> app.set('views', __dirname + '/views'); //tells Express where our views
>>>> are stored
>>>> app.set('translation', require(__dirname + '/public/locales/dev/**
>>>> translation.json'));
>>>> app.set('chapters', require(__dirname + '/data/chapters.json'));
>>>> app.set('view engine&

[nodejs] node-gyp and /clr option for msbuild

2013-01-31 Thread José F . Romaniello
Is there a way to configure de binding.gyp in order to use /clr option in
msbuild.

I am getting this error when I try to build

..\src\myaddon.cpp(3): fatal error C1190: managed targeted code requires a
'/clr' option

thanks

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[nodejs] Re: node-gyp and /clr option for msbuild

2013-01-31 Thread José F . Romaniello
I just find it... it works with something like this.. but now I have an 
error with EHs not being compatible with /clr 

{
  'targets': [
{
  'target_name': 'EventLog',
  'conditions': [
  ['OS=="win"', {
'msvs_settings': {
'VCCLCompilerTool': {  
  'RuntimeTypeInfo':'true',
  'RuntimeLibrary':'MultiThreadedDLL'
}
},
'msbuild_settings': {
  'ClCompile': {
'CompileAsManaged':'true'
  }
}
  }]
  ],
  'include_dirs': ['.'],
  'sources': [
'src/EventLog.cpp'
  ]
}
  ]
}

On Thursday, January 31, 2013 9:29:03 AM UTC-3, José F. Romaniello wrote:
>
> Is there a way to configure de binding.gyp in order to use /clr option in 
> msbuild.
>
> I am getting this error when I try to build
>
> ..\src\myaddon.cpp(3): fatal error C1190: managed targeted code requires a 
> '/clr' option
>
> thanks
>

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Re: node-gyp and /clr option for msbuild

2013-01-31 Thread José F . Romaniello
2013/1/31 José F. Romaniello 

> 'ClCompile': {
>
*  'ExceptionHandling': 'Async', *

>'CompileAsManaged':'true'
> }
>

I am close now..

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[nodejs] [ANN] windows-eventlog 1.0.0

2013-01-31 Thread José F . Romaniello
Hi, I just wanted to share my small native addon to write logs in the
Windows Eventlog  (suffice it to say that it only works on Windows
operative systems).

https://github.com/jfromaniello/windowseventlogjs

there is also a winston transport:

https://github.com/jfromaniello/winston-winlog

Besides being useful or not, I think it is at least useful as an small
example for people that want/need to build native node.js addons for
windows using C++/CLR. Not the c++ code because I am not experiented c++
developer but maybe the configuration.

I have configured node-gyp to build everything, but I also package a
prebuild version (for both x64 and ia32) in case you dont want to install
development tools on a server for instance. There is an small powershell
script to generate the prebuild versions on the root prebuilds.ps1.


thanks!

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Elegant way to require('some-app-component')

2013-02-10 Thread José F . Romaniello
kind of off-topic but I used to hate to "calculate" relative paths when
doing require, so what i did is to build an extension for my code editor
that let me search files by name or folder name, and when I select it it
auto calculate the relative path from the file i am editing and insert the
right require clause.

It also let me select node native modules (fs, events, http, etc) and
modules i have installed on my node_modules folder.

This stupid thing really help me a lot on my daily job and saves me a ton
of time.

https://github.com/jfromaniello/sublime-node-require

There is an out-dated gif there demostrating how it works (or used to
work).  If you are on an empty line it will insert something like:

var x = require('./x/foo');

if you are on non-empty file it will do just the require call:

require('./x/foo')




2013/2/9 Isaac Schlueter 

> > The best NPM packages are small and focused
>
> 100% agree.
>
> > having lots of internal dependencies is probably a smell.
>
> Less agree.
>
> Having lots of internal dependencies is normal for things that are
> doing complicated things.  However, it's ideal for them to take a
> relatively small number of things, and turn it into one thing.  Then
> you'll tend to end up with lots of meta-deps, but still a small number
> of 1st-order deps.
>
> Module dependency trees ought to be bushy - ie, not a narrow deep
> tree, and not a flat long tree.  Then, you cna use `npm dedupe` to
> remove duplicates, and simplify things before checking into git and/or
> deploying.
>
>
> > There is really no functional difference between using this vs relative
> requires, it's psychological. It makes me focus on keeping lib pure, and
> the lack of ../ gives me the warm fuzzies.
>
> This is so very telling!  Thank you for this fascinating bit of
> insight.  You captured it so perfectly.
>
> I'd argue that your "warm fuzzies" reaction is 100% valid: a lot of
> ../ in your require paths tends to indicate some inappropriate
> intimacy and merging of concerns.  However, you haven't actually
> solved the problem!  You've only removed the surface manifestation, to
> make it *look* like you're using nicely abstracted components.  But
> those components are not, in fact, nicely abstracted.  They're still
> doing a ../ require into a bag-o-stuff lib folder, but just without
> the ".." in the string.
>
> Why not just put your "emerging utility stuff" in
> node_modules/some-util/ and node_modules/some-other-util/, and do
> require('some-util') in your app code?  List each util as a
> "bundledDependency", and check it into git.  If you ever decide to
> split it out, it's super trivial to do so.
>
> This way, you'll notice right away if you have too much cross-talk
> between them.  Because, if "util-a" is pulling in "util-b", but
> doesn't list "util-b" as a dependency, then that's an easily spotted
> error.  If it DOES list util-b as a dependency, you'll force yourself
> to think, "Wait a second... why does it *actually* have to depend on
> that other thing?", and then wonder if they should be merged (ie, if
> they are tightly bound, and probably not a good abstraction
> independently), or more fully separated.  The smells will be right in
> your face, instead of hidden behind a magic folder.
>
> Over the last year, I've been retroactively doing this with npm, or at
> least, trying to find time to do so, and since things are already
> working, it's hard to justify the time expenditures.  I really wish
> I'd built it this way from the start and a lot of annoying mistakes
> could have been avoided.  Of course, to be fair, at the start, there
> was no npm to make this sort of thing easier to do :), but my point is
> that it's sooo much easier to do up front rather than trying to do it
> later on, once you have a tangled mess.
>
>
> On Sat, Feb 9, 2013 at 12:02 PM, Jacob Groundwater 
> wrote:
> > There is definitely a method to my madness.
> >
> > First, I would only recommend doing this in a deployable application,
> not a
> > module that deploys to NPM. The best NPM packages are small and focused;
> > having lots of internal dependencies is probably a smell.
> >
> > Second, I do this to help filter out code that belongs in a library
> anyways.
> > I have two directories at the root of my project which separate code
> > functionality.
> >
> > /app  <-- contains MVC architecture of web application
> > /lib  <-- contains emerging utility libraries
> >
> >
> > Note that nothing in /lib should directly require anything in /app. The
> > libraries in lib should evolve into separate, and self-contained modules.
> > These are the future candidates for NPM modules.
> >
> > Since modules in lib should behave like external libraries, I require
> them
> > like external libraries. I symlink lib into node_modules.
> >
> > /node_module
> > /lib --> ../lib
> >
> >
> > In your application, you can require any of these modules with
> >
> > var module = require('lib/module');
> >
> >
> > When time comes to actual

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

2013-02-11 Thread José F . Romaniello
thanks!

I think what I meant there is that if you are not already using winston use
just the logger https://github.com/jfromaniello/windowseventlogjs

I really like winston, though


2013/2/11 Benjamin Eidelman 

> Thanks Jose, this is really useful!
>
> I got surprised by the "Esta bueno, pero..." though, I think node.js on
> windows is a first-class citizen, and not just for multi-platform, and the
> eventlog is an excellent transport choice.
>
> Regards,
>
> On Thursday, January 31, 2013 12:11:51 PM UTC-3, José F. Romaniello wrote:
>>
>> Hi, I just wanted to share my small native addon to write logs in the
>> Windows Eventlog  (suffice it to say that it only works on Windows
>> operative systems).
>>
>> https://github.com/**jfromaniello/windowseventlogjs<https://github.com/jfromaniello/windowseventlogjs>
>>
>> there is also a winston transport:
>>
>> https://github.com/**jfromaniello/winston-winlog<https://github.com/jfromaniello/winston-winlog>
>>
>> Besides being useful or not, I think it is at least useful as an small
>> example for people that want/need to build native node.js addons for
>> windows using C++/CLR. Not the c++ code because I am not experiented c++
>> developer but maybe the configuration.
>>
>> I have configured node-gyp to build everything, but I also package a
>> prebuild version (for both x64 and ia32) in case you dont want to install
>> development tools on a server for instance. There is an small powershell
>> script to generate the prebuild versions on the root prebuilds.ps1.
>>
>>
>> thanks!
>>
>  --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Proxy server with authentication

2013-02-14 Thread José F . Romaniello
If you need more than basic auth (user and pass in a header) you will
need also sessions, so rather than the http-proxy i will recommend you
using connect/express + passport, and to pipe the requests after
validating the user thru mikeal/request.

This is more than just a proxy. Imho there is no such thing as proxy
WITH authentication.

Do not use bodyparser middleware since it will read all the stream and
you will not be able to fully pipe the requests.

2013/2/14, jal...@algotree.com :
> Hi,
>
>
> I have an elasticsearch database and an clients make ajax queries from the
> javascript files served by apache, What I am trying to build is a proxy
> server in nodejs which authenticates both the request to apache  and ajax
> queries.
>
> I have built a proxy server using nodejitsy/node-http-proxy in front of
> apache and elasticsearch, How do i go about authentication as mentioned
> above.
>
> Thanks
>
> --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Enviado desde mi dispositivo móvil

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Proxy server with authentication

2013-02-14 Thread José F . Romaniello
Ob sorry, i nver used passport other than as a connect middleware, and as
I said he probabily needs some kind of sessions to store at least the user
is logged in. So, i think connect will be easier. But if you know any other
way please go ahead

i know also you could use connect and http proxy on the same instance of
the http server

El jueves, 14 de febrero de 2013, Bradley Meck escribió:

> Any reason not to use http-proxy and passport without express?
>
> --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com .
> For more options, visit https://groups.google.com/groups/opt_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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Proxy server with authentication

2013-02-15 Thread José F . Romaniello
@greelgorke and what do you suggest for session management as @jalalm
suggest he wants to authenticate the user in one route and then have the
information available in other routes?


2013/2/15 greelgorke 

> in your gist: you dopn't need express here. look at examples here:
> http://passportjs.org/guide/authenticate/ you can just use
> passport.authenticate in your request handler after checking the methods
>
> Am Freitag, 15. Februar 2013 15:45:48 UTC+1 schrieb jal...@algotree.com:
>
>> Thanks,
>>
>> This is the gist link to the simple proxy server code that i wrote using
>> express and node-http-proxy
>>
>> https://gist.github.com/**jalaluddeen/4960691<https://gist.github.com/jalaluddeen/4960691>
>>
>> what i wanna do is add authentication and session management to this so
>> that only requests from authenticated users are passed to apache or
>> elasticsearch.
>>
>>
>> On Friday, February 15, 2013 2:17:19 PM UTC+5:30, greelgorke wrote:
>>>
>>> yes, passportjs is a good choice. the examples on passportjs.org use
>>> express routes, but the important parts are passport.authenticate calls.
>>> it's agnostic enough.
>>>
>>> Am Freitag, 15. Februar 2013 01:02:26 UTC+1 schrieb José F. Romaniello:
>>>>
>>>> Ob sorry, i nver used passport other than as a connect middleware, and
>>>> as I said he probabily needs some kind of sessions to store at least the
>>>> user is logged in. So, i think connect will be easier. But if you know any
>>>> other way please go ahead
>>>>
>>>> i know also you could use connect and http proxy on the same instance
>>>> of the http server
>>>>
>>>> El jueves, 14 de febrero de 2013, Bradley Meck escribió:
>>>>
>>>>> Any reason not to use http-proxy and passport without express?
>>>>>
>>>>> --
>>>>> --
>>>>> Job Board: http://jobs.nodejs.org/
>>>>> Posting guidelines: https://github.com/joyent/**
>>>>> node/wiki/Mailing-List-**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<http://groups.google.com/group/nodejs?hl=en?hl=en>
>>>>>
>>>>> ---
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "nodejs" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to nodejs+unsubscribe@**googlegroups.com.
>>>>> For more options, visit 
>>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Proxy server with authentication

2013-02-15 Thread José F . Romaniello
Sorry @greelgorke but I am not totally convinced but your advice to
@jalalm, this is what connect is meant to do and there already a lot of
middlewares implemented for this. In addition to implementing a session
strategy on top of the http you will have also to handle cookies.

All these things are very small per-se but also connect is small and it is
already done.

On the other hand every example you have shown from the documentation of
Passport.js refers to its usage as a connect middleware. So, if you want to
use in the http request handler, you have to do some tricks for the "next"
argument.

With all this peaces of information I dont understand the argument about
not using connect.


So, I am still sold to my first advice; use connect+passport+session (with
some store like redis).. When you have this problem solved, you can pipe
requests to other server either using mikeal/request pipe functionality as
shown here:

https://github.com/mikeal/request#streaming

Or using the http-proxy in the same instance of http server.



2013/2/15 greelgorke 

> passport handles sessions by default, so you have to disable them if you
> dont want sessions. see here http://passportjs.org/guide/configure/ how
> to handle sessions. you could throw in a memory db like memcached or redis,
> or just hold it in memory by yourself. for distributed proxy i'd suggest
> redis or even a rdbms.
>
> Am Freitag, 15. Februar 2013 17:07:53 UTC+1 schrieb José F. Romaniello:
>>
>> @greelgorke and what do you suggest for session management as @jalalm
>> suggest he wants to authenticate the user in one route and then have the
>> information available in other routes?
>>
>>
>> 2013/2/15 greelgorke 
>>
>>> in your gist: you dopn't need express here. look at examples here:
>>> http://passportjs.org/**guide/authenticate/<http://passportjs.org/guide/authenticate/>you
>>>  can just use passport.authenticate in your request handler after
>>> checking the methods
>>>
>>> Am Freitag, 15. Februar 2013 15:45:48 UTC+1 schrieb jal...@algotree.com:
>>>
>>>> Thanks,
>>>>
>>>> This is the gist link to the simple proxy server code that i wrote
>>>> using express and node-http-proxy
>>>>
>>>> https://gist.github.com/**jalalu**ddeen/4960691<https://gist.github.com/jalaluddeen/4960691>
>>>>
>>>> what i wanna do is add authentication and session management to this so
>>>> that only requests from authenticated users are passed to apache or
>>>> elasticsearch.
>>>>
>>>>
>>>> On Friday, February 15, 2013 2:17:19 PM UTC+5:30, greelgorke wrote:
>>>>>
>>>>> yes, passportjs is a good choice. the examples on passportjs.org use
>>>>> express routes, but the important parts are passport.authenticate calls.
>>>>> it's agnostic enough.
>>>>>
>>>>> Am Freitag, 15. Februar 2013 01:02:26 UTC+1 schrieb José F. Romaniello:
>>>>>>
>>>>>> Ob sorry, i nver used passport other than as a connect middleware,
>>>>>> and as I said he probabily needs some kind of sessions to store at least
>>>>>> the user is logged in. So, i think connect will be easier. But if you 
>>>>>> know
>>>>>> any other way please go ahead
>>>>>>
>>>>>> i know also you could use connect and http proxy on the same instance
>>>>>> of the http server
>>>>>>
>>>>>> El jueves, 14 de febrero de 2013, Bradley Meck escribió:
>>>>>>
>>>>>>> Any reason not to use http-proxy and passport without express?
>>>>>>>
>>>>>>> --
>>>>>>> --
>>>>>>> Job Board: http://jobs.nodejs.org/
>>>>>>> Posting guidelines: https://github.com/joyent/**node**
>>>>>>> /wiki/Mailing-List-**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@**googlegroup**s.com
>>>>>>> For more options, visit this group at
>>>>>>> http://groups.google.com/**group**/nodejs?hl=en?hl=en<http://groups.google.com/group/nodejs?hl=en?hl=en>
>>&

Re: [nodejs] Native Windows services in Node.js

2013-02-16 Thread José F . Romaniello
I used nssm once and did this https://github.com/jfromaniello/winser

El sábado, 16 de febrero de 2013, Stephen Vickers escribió:

> Hi All,
>
> I am considering an attempt to implement native Windows service support
> for Node.js.
>
> For myself it's purely a learning excercise, and at this stage I have no
> idea it will work.
>
> Would anyone use such a module?
>
> Thanks
>
> Steve
>
> --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com .
> For more options, visit https://groups.google.com/groups/opt_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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] windows-service - Run Node.JS programs as native Windows Services.

2013-02-22 Thread José F . Romaniello
Windows-service looks very nice, well done!

Jeremy: winser is a wrapper around nssm with some friendly defaults for
node.js. It will install the application as a service and it will run it
with "npm start". Some PROs I see in *winser/nssm*:

   - nssm in my opinion has more time around and it has an special behavior
   for exits. See Service shutdown, Actions on exit and Restart throttling in
   this link .
   - winser doesn't need python, Visual Express, etc in order to install.
   Stephen you can workaround this with a fallback to a prebuilt binary in
   your package, please have a look to my windows event
logpackage, it try
to build but if the build fail it will use a prebuilt
   version.
   - when running the application with winser the *current working directory
   * is the place where you have the package.json file, no need to change
   that

Pros I see in *windows-service*

   - an api to define services inside node. The examples shown in the
   readme are very good and if you think about it there are a lot of things
   that work in that way, (with --install, etc)
   - no extra dependencies, since it is all done in c





2013/2/22 Jeremy Darling 

> What is the difference in this and WinSer using NSSM?  I'm not picking I'm
> just curious.
>
>
> On Thu, Feb 21, 2013 at 4:41 PM, Stephen Vickers 
> wrote:
>
>> Hi All,
>>
>> I've created a new module named "windows-service" providing the ability
>> to run Node.JS programs as native Windows Services.
>>
>> The new module can be installed using npm:
>>
>> https://npmjs.org/package/windows-service
>>
>>  Steve
>>
>> --
>> --
>> 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
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "nodejs" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to nodejs+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] windows-service - Run Node.JS programs as native Windows Services.

2013-02-22 Thread José F . Romaniello
Sure thing Stephen! I am the author of winser and I gave my point of view
on your project and as I said it looks *very nice*, I will consider next
time i have to deploy something to a windows server.

for me node.js is about alternatives, so i am really glad winser is not the
only option to run node programs as windows services now

regards


2013/2/22 Stephen Vickers 

> I should also add, I don't want to appear to be critical of WinSer, or
> nssm.exe for that matter.  It's just that I have my own motivations,
> requirements and preferences, as do the authors of those programs.
>
>
> On Friday, 22 February 2013 12:17:56 UTC, Stephen Vickers wrote:
>>
>> Hi Jeremy,
>>
>> A number of small reasons why I would use windows-service instead (some
>> people may consider some of these points moot, I don't):
>>
>>- Node.js and program path detection is automatic and obvious
>>- Supports spaces in service names (although this could be fixed
>>quite easily in WinSer)
>>- Doesn't depend on npm to add, remove and run services
>>- Doesn't depend on nssm.exe which means one less task of trying to
>>keep that up to date (not assuming the module author will always want to
>>update nssm.exe to the latest version when available)
>>   - Which also may have library dependency issues - unless
>>   you compile it yourself
>>
>> Then there a couple of major reasons, which are probably
>> more in-line with my requirements.
>>
>> I've already written something similar for Perl, for the company I work
>> for, but have never been allowed to make that code public.
>>
>> I'm just getting into Node.js with the view of writing an application
>> delivered using a Windows installer (NSIS based) as the end systems will
>> have no build environment available.
>>
>> So, in part this was a learning exercise to see if it was possible, and
>> to remove dependency on npm for a deployed application.
>>
>> It's also worth considering that the service code base is much smaller
>> than the nssm.exe code base, and this is not a criticism of nssm.exe (quite
>> the opposite, it seems like a very good program), the point is that there
>> is less to go wrong and maintain.
>>
>> Steve
>>
>> On Friday, 22 February 2013 03:06:14 UTC, Jeremy wrote:
>>>
>>> What is the difference in this and WinSer using NSSM?  I'm not picking
>>> I'm just curious.
>>>
>>>
>>> On Thu, Feb 21, 2013 at 4:41 PM, Stephen Vickers wrote:
>>>
 Hi All,

 I've created a new module named "windows-service" providing the ability
 to run Node.JS programs as native Windows Services.

 The new module can be installed using npm:

 https://npmjs.org/package/**windows-service

  Steve

 --
 --
 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 nod...@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+un...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/nodejs?hl=en?hl=en

 ---
 You received this message because you are subscribed to the Google
 Groups "nodejs" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to nodejs+un...@googlegroups.com.
 For more options, visit 
 https://groups.google.com/**groups/opt_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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_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/nod

Re: [nodejs] NPM Readme vs Github Readme

2013-02-24 Thread José F . Romaniello
Not that I disagree with Isaacs, but regardless of what you use for your
module and regardless if you prebuild before pushing it or your module
depends on coffescript (i dont suggest this), it seems important to me that
you document it with javascript examples so you can reach a bigger audience
because it is the min common denominator.

And please dont you dare to start the discussion about cs vs js again.
El 24/02/2013 14:05, "Isaac Schlueter"  escribió:

> We only highlight JavaScript code correctly on the website.  I'd like
> to just not automatically highlight any other language, actually.
> (There are often command line examples or output samples that get
> highlighted strangely.)
>
> Example code should be in JavaScript because CoffeeScript packages
> should be prebuilt and published as JavaScript.  That is the lingua
> franca of the web, and the language of Node.js.
>
>
> On Sat, Feb 23, 2013 at 7:59 AM, Diogo Resende 
> wrote:
> > It seems to work for me, the only thing that doesn't seem to highlight
> > correctly is coffee script.
> >
> > --
> > Diogo Resende
> >
> > On Saturday, February 23, 2013 at 15:37 , Tim Caswell wrote:
> >
> > I would think the easiest route would be sending Isaac a pull request
> > (assuming the npm website is on github).  I can't imagine he would be
> > against making this match github's markdown features.
> >
> >
> > On Fri, Feb 22, 2013 at 7:13 AM, Michal Srb  wrote:
> >
> > Hi,
> >
> > I was trying to find any information about this, but I couldn't. It seems
> > that NPM's README rendering (on NPM website), does not use Github
> flavored
> > markdown. How can I / should I practically include two separate README
> > files, one for github and one for npm? What is the best practice?
> >
> > For example of failure, compare:
> >
> > https://npmjs.org/package/metacoffee
> > https://github.com/xixixao/meta-coffee
> >
> > Thanks,
> >
> > Michal
> >
> > --
> > --
> > 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
> >
> > ---
> > You received this message because you are subscribed to the Google Groups
> > "nodejs" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to nodejs+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/groups/opt_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
> >
> > ---
> > You received this message because you are subscribed to the Google Groups
> > "nodejs" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to nodejs+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/groups/opt_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
> >
> > ---
> > You received this message because you are subscribed to the Google Groups
> > "nodejs" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to nodejs+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/groups/opt_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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving

Re: [nodejs] How to handle errors for a batch fo async calls

2013-02-25 Thread José F . Romaniello
+1 on event emitter. Callback with an array of errors is not that common.
You should return an event emitter with complete and error events. be aware
that when you emit an 'error' event and no one is listening in the
application exits


2013/2/25 Pedro Teixeira 

> Hey Glenn,
>
> For something this complex I think an event emitter may be better suited.
>
> --
> Pedro
>
> On Monday, February 25, 2013 at 9:57 AM, Glenn Block wrote:
>
> Hello all
>
> Let's assume you have an API that results in a batch of HTTP calls which
> fire async and which are not sequential. A constraint of the API is that
> any errors that occur during the calls need to get returned to the user.
>
> How have you customarily designed this?
>
> One idea was something like the following
>
> function send(message, callback) {
> }
>
> where callback is function(error, results) {
> }
>
> In this case error if not null is a JSON object with a collection of child
> objects with the errors.
>
> An alternative idea I had was to have an additional completion callback
> per item.
>
> so:
>
> function send(message, completionCallback, itemCallback) {
> }
>
> This introduces a callback for each item that is processed. In this case
> the completion callback has a single error if ANY errors occur while the
> itemCallback has individual errors as they occur.
>
> This is useful for cases where you might want to stop further processing
> if the number of errors is very high.
>
> Thoughts / Experiences?
> Glenn
>
>
>
>  --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] How to handle errors for a batch fo async calls

2013-02-25 Thread José F . Romaniello
yes

http://nodejs.org/api/events.html#events_class_events_eventemitter


2013/2/25 Glenn Block 

> Jose, thanks for the clarification.
>
> Literally right after sending the mail I was thinking I forgot all about
> event emitters :-)
>
> In terms of error, are you saying that any time you emit an event called
> "Error" the runtime exits if there is no listener?
>
>
>
>
> On Mon, Feb 25, 2013 at 3:12 AM, José F. Romaniello <
> jfromanie...@gmail.com> wrote:
>
>> +1 on event emitter. Callback with an array of errors is not that common.
>> You should return an event emitter with complete and error events. be
>> aware that when you emit an 'error' event and no one is listening in the
>> application exits
>>
>>
>> 2013/2/25 Pedro Teixeira 
>>
>>> Hey Glenn,
>>>
>>> For something this complex I think an event emitter may be better suited.
>>>
>>> --
>>> Pedro
>>>
>>> On Monday, February 25, 2013 at 9:57 AM, Glenn Block wrote:
>>>
>>> Hello all
>>>
>>> Let's assume you have an API that results in a batch of HTTP calls which
>>> fire async and which are not sequential. A constraint of the API is that
>>> any errors that occur during the calls need to get returned to the user.
>>>
>>> How have you customarily designed this?
>>>
>>> One idea was something like the following
>>>
>>> function send(message, callback) {
>>> }
>>>
>>> where callback is function(error, results) {
>>> }
>>>
>>> In this case error if not null is a JSON object with a collection of
>>> child objects with the errors.
>>>
>>> An alternative idea I had was to have an additional completion callback
>>> per item.
>>>
>>> so:
>>>
>>> function send(message, completionCallback, itemCallback) {
>>> }
>>>
>>> This introduces a callback for each item that is processed. In this case
>>> the completion callback has a single error if ANY errors occur while the
>>> itemCallback has individual errors as they occur.
>>>
>>> This is useful for cases where you might want to stop further processing
>>> if the number of errors is very high.
>>>
>>> Thoughts / Experiences?
>>> Glenn
>>>
>>>
>>>
>>>  --
>>> --
>>> 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
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "nodejs" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to nodejs+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_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
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "nodejs" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to nodejs+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_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 &q

Re: [nodejs] How to handle errors for a batch fo async calls

2013-02-25 Thread José F . Romaniello
quoting docs:

When an EventEmitter instance experiences an error, the typical action is
to emit an 'error' event. Error events are treated as a special case in
node. If there is no listener for it, then the default action is to print a
stack trace and exit the program.


2013/2/25 Glenn Block 

> Jose, thanks for the clarification.
>
> Literally right after sending the mail I was thinking I forgot all about
> event emitters :-)
>
> In terms of error, are you saying that any time you emit an event called
> "Error" the runtime exits if there is no listener?
>
>
>
>
> On Mon, Feb 25, 2013 at 3:12 AM, José F. Romaniello <
> jfromanie...@gmail.com> wrote:
>
>> +1 on event emitter. Callback with an array of errors is not that common.
>> You should return an event emitter with complete and error events. be
>> aware that when you emit an 'error' event and no one is listening in the
>> application exits
>>
>>
>> 2013/2/25 Pedro Teixeira 
>>
>>> Hey Glenn,
>>>
>>> For something this complex I think an event emitter may be better suited.
>>>
>>> --
>>> Pedro
>>>
>>> On Monday, February 25, 2013 at 9:57 AM, Glenn Block wrote:
>>>
>>> Hello all
>>>
>>> Let's assume you have an API that results in a batch of HTTP calls which
>>> fire async and which are not sequential. A constraint of the API is that
>>> any errors that occur during the calls need to get returned to the user.
>>>
>>> How have you customarily designed this?
>>>
>>> One idea was something like the following
>>>
>>> function send(message, callback) {
>>> }
>>>
>>> where callback is function(error, results) {
>>> }
>>>
>>> In this case error if not null is a JSON object with a collection of
>>> child objects with the errors.
>>>
>>> An alternative idea I had was to have an additional completion callback
>>> per item.
>>>
>>> so:
>>>
>>> function send(message, completionCallback, itemCallback) {
>>> }
>>>
>>> This introduces a callback for each item that is processed. In this case
>>> the completion callback has a single error if ANY errors occur while the
>>> itemCallback has individual errors as they occur.
>>>
>>> This is useful for cases where you might want to stop further processing
>>> if the number of errors is very high.
>>>
>>> Thoughts / Experiences?
>>> Glenn
>>>
>>>
>>>
>>>  --
>>> --
>>> 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
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "nodejs" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to nodejs+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_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
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "nodejs" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to nodejs+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>
>>  --
>> --
>> Job Board: http://jobs.nodejs.

Re: [nodejs] Re: NPM Readme vs Github Readme

2013-02-26 Thread José F . Romaniello
sorry I didn't see your repository before, I understand now


2013/2/26 xixixao 

> Thanks for the answers, but if any of you have actually looked at my repo,
> it is a parser generator which embeds CoffeeScript. I really don't know how
> to make examples in JavaScript for it.
>
> I also have to say, appreciating the Node community and loving the
> technology, this "lingua-racism" against CoffeeScript seems very childish
> to me :).
>
> I guess ignoring the language tag would then be the best option, not
> giving any syntax highlighting for other than JS.
>
> (Oh, missed the last note from Jose, I apologize, no one has to react and
> I can be deemed libertarian extremist :D ).
>
> Thanks again.
>
>  --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Re: Running CLR/.NET code in-process with node.js

2013-02-27 Thread José F . Romaniello
Looks great, already told you on twitter.

There are cases where I would prefer this to an mq/worker solution.

A good example that I was thinking is a middleware to log events in windows
event log. It is not a CPU bound operation but event log will be easy to
use from .net. I already did a native module but this could be easier and
better.

El 27/02/2013 20:07, "Tomasz Janczuk"  escribió:
>
> Currently you cannot choose the name of the method to call in .NET,
> but you are not the first one asking, so I will be adding this
> shortly.
>
> You can have several CLR classes in one assembly and choose one this
> way: https://github.com/tjanczuk/owin/issues/2
>
> On Feb 27, 1:59 pm, mickael.metesr...@gmail.com wrote:
> > Hi,
> >
> > I spent some time trying your project and I am very exciting about the
> > connecting nodejs and .NET possibility.
> >
> > I focused on handling requests and process them with .NET 4.5 and I
easily
> > succeed to create simple REST application.
> >
> > First of all, is it possible to choose the name of the method calling by
> > the connector (ie: MyMethod instead of Startup)?
> >
> > Then, can we connect several requests to different methods from the same
> > assembly?
> >
> > Thanks,
> >
> > Mickael Metesreau
>
> --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups
"nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to nodejs+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] RFC: Looking for guidance on NPM

2013-03-07 Thread José F . Romaniello
IMHO there is not a rigid technical distinction between application and
module from the npm stand point. Your application will have a package.json
like any other module, with the dependencies.

If your application is a command line utility you have to put a
*bin*attribute in your package.json pointing to your script, publish
to npm, and
when you want to install from another machine use the -g option.

When your module/application is ready to be used as a dependency for other
modules, you will have to add a *main *attribute to your package.json.

http://package.json.nodejitsu.com/
https://npmjs.org/doc/json.html


2013/3/7 Justin Novack 

> Hello World!
>
> Is the npm registry for modules or applications?  There's conflicting
> words in the documentation.
>
> Long story short (too late!), upon seeing LIFX, and inspired by the NodeJS
> Socket Lights video on Vimeo, I figured NodeJS would be a perfect minimal
> app to control the lights.  So, I have my first proof of concept working
> with protocol buffers without the SDK being released, and I put it up on
> npm (lifx.js) to both dip my feet in and encourage more development.
>
> But it's currently NOT a module you can call do to something, currently,
> it's just an app.  Eventually, I see it both as a front (app) and back
> (module) end, but I'm not there yet.  Am I executing poor form by putting
> it up on npm?  I am really just trying to get a feel for the community and
> learn best practices. I'm only a week in, be gentle.
>
> Thank you for your consideration.
>
> --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Found a really nice video about NodeJS

2013-03-13 Thread José F . Romaniello
he uses node in the clandestinity, just hasn't come out of the closet yet.

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] [ANN] address-rfc2822

2013-03-18 Thread José F . Romaniello
I was talking about this few days ago and I love what Travisi does.
Previously, I used to have an xunit kind of formater for my tests because
that is what most CI servers understand, but sometimes this is kind of
overengineer, and it fails, which make me think if it is really important
for a CI server to read tests names and result in a machine language. After
using travis I think I am sold to the idea of having a very clean output as
plain text and being able to read that.

After all, "the standarized output format" is the exit status code

And yes i don't care the statistics about how many tests have been added
last week.



2013/3/18 Arunoda Susiripala 

> As martin mentioned travis does support multiple node versions. I agree we
> do not have multiple platforms when its come to travis. Since node use as
> Server Side JS for most of the apps, I think that won't be a big issue.
>
> BTW: there are TAP formatters for almost every node testing frameworks.
>
>
> On Mon, Mar 18, 2013 at 8:46 PM, Matt  wrote:
>
>> Travis is great, but covers one OS and one version of Node (from what I
>> can tell). Cpantesters covers about 15 different OS's and over 60 versions
>> of Perl, and scales this way because they distribute the problem to end
>> users. It includes current development versions of Perl as well as current
>> and past stable versions. Travis is pretty weak in comparison.
>>
>>
>> On Mon, Mar 18, 2013 at 9:53 AM, Arunoda Susiripala <
>> arunoda.susirip...@gmail.com> wrote:
>>
>>> Lack of tests
>>> Have you seen travis-ci.
>>>
>>>
>>> On Monday, March 18, 2013, Matt wrote:
>>>
 On Mon, Mar 18, 2013 at 6:59 AM, Thomas Shinnick wrote:

> 
> So many good old modules, accidentally duplicated by the new and
> eager, without reference to existing Perl/Python/whatever implementations.
> So many old mistakes, new again...
> 
>

 I think the biggest mistakes in the node community are the lack of
 tests for npm modules, and the lack of a standardised output format (TAP)
 meaning that building something like http://static.cpantesters.org/will be 
 hard(er). It's pretty amazing in the Perl community to be able to
 release something and then a day later get a full report of cross
 platform/version compatibility from an army of build systems.

 --
 --
 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

 ---
 You received this message because you are subscribed to the Google
 Groups "nodejs" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to nodejs+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.



>>>
>>>
>>> --
>>> Arunoda Susiripala
>>>
>>> @arunoda 
>>> https://github.com/arunoda
>>> http://www.linkedin.com/in/arunoda
>>>
>>>  --
>>> --
>>> 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
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "nodejs" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to nodejs+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_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
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "nodejs" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to nodejs+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
>
> --
> Arunoda Sus

Re: [nodejs] Anyone interested in a fully featured boilerplate for advanced/large single page web apps?

2013-03-25 Thread José F . Romaniello
2013/3/25 Jake Verbaten 

> typical node projects use npm & browserify for frontend. NOT bower.


where does this data come from?

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] urldecode?

2013-03-26 Thread José F . Romaniello
decodeURI and decodeURIComponent works on browsers and node


2013/3/26 Angelo Chen 

> Hi,
>
> is there a function nodejs can urldecode a string? Thanks,
>
> Angelo
>
> --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Pass local variable to callback function?

2013-03-28 Thread José F . Romaniello
You can do two things. Use
bind
:

DescriptorValue.prototype.parse = function() {

var currentModuleName = GLOBALS.PARSERSDIR+this.parameters.name+'.js';
fs.exists(currentModuleName, function(exists) {
if (exists) {
var currentparser = require(currentModuleName);
currentparser.parse(this);
} else {
//getValue();
}
}.bind(this));
}

or declare a new variable and store the value of this:

DescriptorValue.prototype.parse = function() {
var currentModuleName = GLOBALS.PARSERSDIR+this.parameters.name+'.js';
var self = this;

fs.exists(currentModuleName, function(exists) {
if (exists) {
var currentparser = require(currentModuleName);
currentparser.parse(self);
} else {
//getValue();
}
});
};

either approach is okay for this case.



2013/3/28 Perrier 

> Hi,
>
> I have a class (DescriptorValue) and its following function:
>
> DescriptorValue.prototype.parse = function() {
> var currentModuleName = GLOBALS.PARSERSDIR+this.parameters.name+'.js';
> fs.exists(currentModuleName, function(exists) {
> if (exists) {
> var currentparser = require(currentModuleName);
> * currentparser.parse(this);*
> } else {
> //getValue();
> }
> });
> }
>
> I'd like to pass the DescriptorValue object itself to the parse method of
> the loaded module (currentparser) in the line with bold. I've seen several
> examples but can not solve this. Should I change this structure thus
> DescriptorValue's parse method shouldn't exist? This way the task of this
> method could be done from a function outside. But still, how can I pass a
> local variable into fs.exists' callback?
> Could you please help me?
>
> Thanks, Peter
>
>  --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Google API, OAuth 2.0 for Server to Server Applications, node.js library

2013-03-29 Thread José F . Romaniello
I think my friend Gustavo did this to talk with big query:

https://github.com/machadogj/node-jwt-sign


2013/3/29 Oleg Lebedev 

> Hi!
>
> Anybody knows node.js library for server to server authentication?
> Docs is here:
> https://developers.google.com/accounts/docs/OAuth2ServiceAccount
>
> Thanks!
>
> --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] ECMAScript 6, asm.js, can node.js dump V8 or be VM agnostic?

2013-04-03 Thread José F . Romaniello
I think this might be of interest:

https://github.com/creationix/luvmonkey

quoting:

> This project is an effort to create a custom SpiderMonkey runtime that
has libuv built-in. This will give it very node.js-like semantics, but
using a different JavaScript engine.



2013/4/3 cpprototypes 

> I was recently excited to find out that V8 is starting work on adding
> generators support.  Then I heard about asm.js and looked into Firefox's
> *Monkey (OdinMonkey, SpiderMonkey, etc.) series of JS engines.  Performance
> is good, they've already implemented many ECMAScript 6 features, and now
> asm.js support is added.  Looking at all this, it feels like V8 is falling
> behind and stagnant.  Also Google is working on Dart which is a competitor
> to JS technologies.  Mozilla seems to be "all in" on JS tech instead of
> divided like Google.  If node.js used *Monkey instead of V8, I can imagine
> a future world like this:
>
> 1) Node.js would get future ECMAScript updates faster (ECMAScript 6, 7,
> etc.)
>
> 2) In the python community, the common way to handle performance is to
> first write it in python, then optimize heavy loop/CPU areas in C code.  A
> similar thing could be done in node.js, write first in regular JS, optimize
> heavy loops/CPU with LLJS (http://mbebenita.github.com/LLJS it's a static
> typed dialect of JS) or C/C++.
>
> 3) Existing native libraries could compiled to asm.js, expanding the areas
> node.js can be used.  For instance, in python NumPy is a python layer for
> very fast C math libraries.
>
> Switching node.js to *Monkey or at least making it VM agnostic would be a
> huge task.  And it's possible V8 will eventually implement asm.js and other
> JS technologies made by Mozilla.  But it seems like Mozilla is pushing the
> boundaries of JS technology and opening paths to new areas.  I'm curious if
> the node.js developers have discussed the idea?
>
>
>  --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] ECMAScript 6, asm.js, can node.js dump V8 or be VM agnostic?

2013-04-03 Thread José F . Romaniello
Suppose you build a node clone with mozilla js engine and you can use
asm.js, would that, to some extend, reduce the need of native addons?

Ps: +1 on kickstarter.
El 03/04/2013 21:23, "Stephen Belanger"  escribió:

> To Kickstarter! :O
> On 3 Apr 2013 17:12, "Ben Noordhuis"  wrote:
>
>> On Wed, Apr 3, 2013 at 10:55 PM, Tim Caswell  wrote:
>> > I would love to see luvmonkey finished.  Once the core spidermonkey <->
>> > libuv bindings were complete, the rest could be implemented in pure JS
>> on
>> > top.  Someone could clone the node.js APIs in pure JS on top of
>> luvmonkey.
>> >
>> > From what I know about node's development, changing engines will never
>> > happen unless V8 completely dies and stops working.  It's a huge task to
>> > make node and binary node addons work with an engine other than V8.
>>  There
>> > is a lot of tight coupling there.
>> >
>> > Honestly, I think the easiest path is to find some people with
>> motivation,
>> > time, and skill to complete the luvmonkey bindings and then start a
>> > community effort to replicate the node.js userspace in js.
>>
>> I would like to pick up luvmonkey development again.  The great thing
>> about SpiderMonkey is that it runs on many more platforms and
>> architectures than V8 (notably SPARC, POWER and PA-RISC, all still big
>> in the enterprise.)  Porting libuv to HP-UX and AIX would be something
>> of an undertaking but it's certainly feasible.
>>
>> The prime issue is, of course, lack of time and/or funds.
>>
>> --
>> --
>> 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
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "nodejs" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to nodejs+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Re: Minimal "pseudo-promises" implementation. Feedback requested.

2013-04-08 Thread José F . Romaniello
2013/4/4 Michael Schoonmaker 

> and my promise implementations of choice
>

Hi Michael, just curious what's the promise implementation you are using?

And is there a list of Promises/A+ compatible implementations

thanks a lot

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[nodejs] [ANN] mongo-getdb a very opinionated way to connect to mongodb

2013-04-20 Thread José F . Romaniello
Hi I just published mongo-getdb which is the way I use to connect to
mongodb. I did this module because connecting to mongodb with the defacto
driver, "right" is far from trivial.

Most of the time you just want to have a the url to mongo in your env and
call something to return a db instance which should be singleton for the
lifecycle of the application.

KeepAlive=300 seems to work well on some cloud infrastructures like Azure.
Don't know why to be honest, and there are other settings that have proven
to be OK for us most of the time.

Any feedback is welcome.

https://github.com/jfromaniello/mongo-getdb
https://npmjs.org/package/mongo-getdb

regards,

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[nodejs] [ANN] auth0, security and authentication open source modules

2013-04-20 Thread José F . Romaniello
We  are very proud to share with you guys our product
named Auth0  which is based on a lot of opensource
modules some from us and some from the community.

I'm not going to talk about Auth0 since it is not the purpose of this mail.

We tried to extract most of the things out of the core and here is a vague
list of what we have published to the wild so far:

   - node-waad : query windows azure
   active directory graphs.
   -

   gapps-provisioning
 Google
   Apps Provisioning
Apiclient
for node.
-

   xml-encryption 
   W3C XML Encryption implementation http://www.w3.org/TR/xmlenc-core/
- wsfed  Ws-Federation middleware
   for node. You can use this to create a Security Token Service that speaks
   WS-Federation/Saml.
   - passport-windowsauth
Windows Authentication
strategy for Passport.js
   - 
passport-linkedin-oauth2Passport
strategy for Linkedin oauth2 api.
   - passport-wsfed-saml2
Ws-Federation + SAML
strategy for Passport.
   - passport-hawk  Passport
   strategy for the Hawk authentication
scheme
   .
   - passport-auth0  is the
   passport.js strategy for Auth0 :)
   - saml : Create saml assertions for
   node.js.
   - node-azure-store  a
   template for Windows Azure Store apps in node.js.
   - sql-federation-server
an example
WS-Federation server that validate users from a sql server db.
   - refresh-token  get a
   valid oauth2 token given a refresh token.
   - ad-federation-server
an example
WS-Federation server that validates users from Active Directory
   in the same way ADFS does.
   - odata-parser  an OData
   parser.
   - ejs-amd  EJS templates to AMD
   modules middleware and converter.
   - selfsigned  Generate self
   signed certificates from node.js,
   - parse-links  Parse LInks
   header into JavaScript object.
   -

   slice-of-life  create
   paginated rest apis easily
-

   url-join  like path.join but
   for urls.
- mongo-getdb  a very
   opinionated way to connect with the mongodb driver.

We have also built an example application called mdocs.io to show Auth0 and
it is opensource:

https://github.com/auth0/mdocs

Which is a google docs-like markdown editor and we just love it.

We did also a workshop last year in Argentina (where most of us are based)
and opensourced all the exercises and slides here (Spanish link):

https://github.com/qraftlabs/node-workshop

we are going to do another one next week.

*We believe that lot of these things could be used to build other great
things and we reaffirm our commitment to open source software in the node
community.*

best regards,

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Re: Install a NodeJS App as a Windows System Service

2013-04-24 Thread José F . Romaniello
2013/4/24 AJ ONeal 

> Someone else was telling me that they've had no problem with NSSM or
> node-windows installing to Program Files,


+1, it works perfectly fine for me.

I have a module called Winser that does uses nssm and install as shwon here:

https://github.com/jfromaniello/winser/blob/master/bin/winser#L94

What i do is to run npm on the folder of the project and the project could
be anywhere. I guess you might be missing some double-quotes "" for the
path.

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] how to send contents of a node.js chat window to another IM app

2013-04-25 Thread José F . Romaniello
W. T. F.
El 25/04/2013 19:12, "trillian"  escribió:

> About to sign up to a service which uses node.js to provide a real-time
> chat window where the info is time sensitive. Is it possible to relay those
> messages to another application in a Windows 7 or Linux VM environment?
> eg relay messages to Skype or Growl to then display those messages on an
> iphone?
>
> Thanks in advance
>
> --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_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

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Running NodeJS and Tomcat Locally

2012-06-04 Thread José F . Romaniello
He said "cross port" and i thougth he was trying to call a rest endpoint in
his node app from the cliendside page served by tomcat. Cross port (this is
Same Origin Policy) is a policy for BROWSERS not for server side Java
running on tomcat.

El lunes, 4 de junio de 2012, nicolas escribió:

> Hello Sean,
>
> From what I understood, your tomcat acts as a client. Therefore you don't
> need JSONP or CORS. You can make direct calls to your node application
> using the HttpUrlConnection. Here is a StackOverflow question and its
> answers:
> http://stackoverflow.com/questions/1359689/how-to-send-http-request-in-java
> .
>
> Then, if your webapp is expecting and/or responding JSON, you will need a
> library to serialize and deserialize it. I'm using Google GSON which do the
> job well: http://code.google.com/p/google-gson/.
> Also, when doing a request, don't forget to put the request's header
> "Content-Type" to "application/json" :)
>
> - Nicolas
>
> On Sunday, June 3, 2012 1:40:36 PM UTC+2, Sean McGowan wrote:
>>
>> I'm running NodeJS locally, with a simple HTTP server on port 8124.
>>
>> I'm running my web application in Tomcat on port 8080.
>>
>> I want my web application to make REST calls to the Node server.
>>
>> Any idas how I get around the cross-port communication issue here?
>>
>> Thanks,
>> Seán
>>
>  --
> 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  'nodejs%2bunsubscr...@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] Running NodeJS and Tomcat Locally

2012-06-04 Thread José F . Romaniello
+1

I like this thing Angel, is like my suggestion of using the http-proxy (
https://github.com/nodejitsu/node-http-proxy ) but you avoid having an
extra process running and managing that. I dont know about the
"http-proxy-servlet" but the node-http-proxy is very straightforward to set
up, examples in the same page.

2012/6/4 Angel Java Lopez 

> Hi people!
>
> Sean, you can combine the two answers, from Nicolas and Jose.
>
> If your browser settings doesn't recognize different ports as same origin,
> you could use a proxy servlet at Tomcat.
>
> Search google for "proxy servlet"
>
> I found:
> http://edwardstx.net/2010/06/http-proxy-servlet/
> that describes a similar situation, and gives some links, one:
> http://frank.spieleck.de/download/ProxyServlet.java
>
> Loosely related, but with more info about 
>
> http://stackoverflow.com/questions/132052/servlet-for-serving-static-content
>
>
> so you can configure your Tomcat accepting /myajaxapi/* all request
> internally serving the Node output, without browser notice. But the proxy
> servlet code could be tricky: it should manage the node.js response
> headers, and serve as is to the browser.
>
> Maybe googleing "proxy servlet for ajax". I just found
> http://www.jroller.com/ray/entry/http_proxy_servlet_for_ajax
>
> Angel "Java" Lopez
> http://ajlopez.wordpress.com
> http://twitter.com/ajlopez
>
>
> On Mon, Jun 4, 2012 at 8:29 AM, José F. Romaniello  > wrote:
>
>> He said "cross port" and i thougth he was trying to call a rest endpoint
>> in his node app from the cliendside page served by tomcat. Cross port (this
>> is Same Origin Policy) is a policy for BROWSERS not for server side Java
>> running on tomcat.
>>
>> El lunes, 4 de junio de 2012, nicolas escribió:
>>
>> Hello Sean,
>>>
>>> From what I understood, your tomcat acts as a client. Therefore you
>>> don't need JSONP or CORS. You can make direct calls to your node
>>> application using the HttpUrlConnection. Here is a StackOverflow question
>>> and its answers:
>>> http://stackoverflow.com/questions/1359689/how-to-send-http-request-in-java
>>> .
>>>
>>> Then, if your webapp is expecting and/or responding JSON, you will need
>>> a library to serialize and deserialize it. I'm using Google GSON which do
>>> the job well: http://code.google.com/p/google-gson/.
>>> Also, when doing a request, don't forget to put the request's header
>>> "Content-Type" to "application/json" :)
>>>
>>> - Nicolas
>>>
>>> On Sunday, June 3, 2012 1:40:36 PM UTC+2, Sean McGowan wrote:
>>>>
>>>> I'm running NodeJS locally, with a simple HTTP server on port 8124.
>>>>
>>>> I'm running my web application in Tomcat on port 8080.
>>>>
>>>> I want my web application to make REST calls to the Node server.
>>>>
>>>> Any idas how I get around the cross-port communication issue here?
>>>>
>>>> Thanks,
>>>> Seán
>>>>
>>>  --
>>> 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
>

-- 
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: Completely new to node.js

2012-06-04 Thread José F . Romaniello
2012/6/4 Angel Java Lopez 

>
>
> Node ecosystem is full of such surprises ;-)
>
>
 Nice to see two c# devs, Angel and Graeme, answering to guy nick named
Csharp, Angel sending links to my friend and coworker Gustavo (also c# dev)
and then the icing on the cake, another csharp-er to *notice all this :)

maybe in few months we can beat phpers in node.js :P

-- 
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 for installing daemons/services on premise (?)

2012-06-04 Thread José F . Romaniello
Hi list, I was thinking today if npm is the right tool to "deploy" or
install my application in servers or vms i own.
Doing:

npm install git://myprivategit-repo -g

>From the vm and then some scripts to "daemonize" it. I am currently
deploying to windows, and converting it to a windows service(no iisnode).
But i think some of the thoughts i have so far are also valide for nix:

-is this a bad practice?

Cons:
-the other thing doesnt feel right is that global packages ends in a folder
inside the user home. And this is not usually the standard place to put an
application.
-i have to log to the server to update! Maybe i can put another thing
listening to updates/ and then do npm update xx

Pros:
-super easy to set up


The other scernario o have explored is to have the folder as a git end
point (and a post receive hook) and pushing to that remote whenever i want
to update. This is hard to set up this in windows at least.. But seems
better in the long run, as the vms and nodes grow.

Also I saw Isaacs fleet, looks very cool but havent tried yet.

Thoughts?

Thanks in advance!

-- 
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] highlight.js for node

2012-06-05 Thread José F . Romaniello
I really like this. I was using Alex Gorbatchev's SyntaxHiglighter but then
I moved to server-side Pygmentize don't know why to be honest.. I love what
I see here:

http://softwaremaniacs.org/media/soft/highlight/test.html


2012/6/5 Oleg Efimov (Sannis) 

> I am very surprised that there was no any announcements about highlight.js
> in this list.
>
> Highlight.js highlights syntax in code examples and initially was created
> for blogs, forums and in fact on any web pages.
> It's very easy to use because it works automatically: finds blocks of
> code, detects a language, highlights it.
> Highlight.js knows 51 languages and (sic!) can perform autodetection of
> code fragment language.
> From some time highlight.js is available as npm module and now support for
> Node.js is merged to highlight.js upstream repo.
>
> Example usage with Node.js:
>
> Pass in Language:
>
> var hl = require("highlight.js");
>
> var text = "var test = 'asdf'";
>
> var result = hl.highlight('javascript', text);
>
> console.log(html.value);
>
> Output: 'var test =  class="string">\'asdf\'',
>
>
> Auto Language Detection:
>
> var hl = require("highlight.js");
>
> var text = "var test = 'asdf'";
>
> var result = hl.highlightAuto(text);
>
> console.log(result.value);
>
>
> GitHub repository: https://github.com/isagalaev/highlight.js
>
> Install via npm for Node.js: npm install highlight.js
>
> Browser version description: http://softwaremaniacs.org/soft/highlight/en/
>
> Regards goes to Ivan Sagalaev, highlight.js creator.
>
> --
> 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] How to setup C++ compiler environment on Win7?

2012-06-05 Thread José F . Romaniello
AFAIK bcrypt doesn't work on windows yet, it can't compile even with a
compilar because it uses openssl (which is *nix specific).

I have found another package with an ugly name, that *apparently* does
bcrypt and is 100% in javascript  https://github.com/jhurliman/node-phpass

don't know if the performance is bad or what..

You might try forking "expressling", and trying to replace bcrypt with
node-phpass.. then you can npm install from your git fork, or add it has a
dependency in your package.json

cheers,

2012/6/5 Thomas White 

> Dear group,
>
> On Windows 7 box I am trying to install  a module called "expressling"
> using NPM, but the installation breaks at the point where the module *bcrypt
> *wants to compile a C++ code.
>
> Can somebody please explain which C++ compiler to install and how to sent
> the environment so the command  'make build' will actually compile the
> module's code?
>
> Thomas
>
> --
> 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] How to setup C++ compiler environment on Win7?

2012-06-05 Thread José F . Romaniello
i think is not yet *that* ready... and the bast majority of native modules
in npm doesn't compile in windows. I think now what most of package authors
do for windows is to publish a version of the package with the already
built dll (the .node extension) inside. (not sure to be honest)

I wrote a tutorial about how to write a native package for windows in
windows (using c++/cli):
http://joseoncode.com/2012/04/10/writing-your-first-native-module-for-node-dot-js-on-windows/

and I also has published the package in npm
http://jfromaniello.github.com/windowseventlogjs/

the package already contains the ".node" file inside, so it doesnt compile
when you install thru npm.. It works but it is not so multi-platform .

2012/6/5 Thomas White 

> José,
> *
> *
> Thank you for your answer. The problem is that some of the modules what
> expressling uses require bcrypt. It seams it will be more complicated
> than I thought.
>
> Apart from this particular case, is it possible to compile C++ node
> modules on  WIn 7 platform?
>
> Thomas
>
>  --
> 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] How to setup C++ compiler environment on Win7?

2012-06-05 Thread José F . Romaniello
you can use "visual c++ express" is fat but it works. This is one throuble
in windows, because in other platforms it is very common to have a compiler
preinstalled, or at least very easy to install.

2012/6/5 José F. Romaniello 

> i think is not yet *that* ready... and the bast majority of native modules
> in npm doesn't compile in windows. I think now what most of package authors
> do for windows is to publish a version of the package with the already
> built dll (the .node extension) inside. (not sure to be honest)
>
> I wrote a tutorial about how to write a native package for windows in
> windows (using c++/cli):
>
> http://joseoncode.com/2012/04/10/writing-your-first-native-module-for-node-dot-js-on-windows/
>
> and I also has published the package in npm
> http://jfromaniello.github.com/windowseventlogjs/
>
> the package already contains the ".node" file inside, so it doesnt compile
> when you install thru npm.. It works but it is not so multi-platform .
>
>
> 2012/6/5 Thomas White 
>
>> José,
>> *
>> *
>> Thank you for your answer. The problem is that some of the modules what
>> expressling uses require bcrypt. It seams it will be more complicated
>> than I thought.
>>
>> Apart from this particular case, is it possible to compile C++ node
>> modules on  WIn 7 platform?
>>
>> Thomas
>>
>>  --
>> 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] process.nextTick in a callback

2012-06-06 Thread José F . Romaniello
this is crazy

i think that what Anand is might want to do is this:


function addAsync(no1, no2, cb)
{
process.nextTick(function() {
res = no1 + no2;
cb(null, res);
});
};

addAsync(1, 2, function(err, res) {
console.log(res);
});

in order to queue the *intensive CPU operation of adding two numbers* for
the next tick in the event loop..


2012/6/6 Oliver Leics 

> On Wed, Jun 6, 2012 at 3:31 PM, Anand George 
> wrote:
> > When I run this code I get the following output.
> >
> > 3
> > 6
> > 3.
> >
> > Any ideas why this could be happening.
>
> This happens because the code does what it has to do.
>
> > It's forcing the calling function to run again.
>
> I don't understand that. What did you expect? Maybe only one line with
> 3? But the code calls the callback two times.
>
> ???
>
> :-)
>
> --
> 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: Event loop blocking. How to detect?

2012-06-06 Thread José F . Romaniello
this might sound very stupid,... but wouldn't be useful to have a parameter
or something to set the max milliseconds a tick can take?

node myapp.js --tick-timeout 6

this means if you have a while(true), or something than takes more than a
minute fail!, raise an exception in the application so you can log it on
the process "uncaughException" event. and something like "forever" will
restart the process.
Maybe there is no way to implement this right now, or maybe there is
something like this already...

cheers,

2012/6/6 Matt 

> This doesn't change the fact that external monitoring is still going to be
> better.
>
> On Wed, Jun 6, 2012 at 1:27 AM, Jeff Willden wrote:
>
>> Some readers are not getting the point. When running node in a
>> production environment, it is assumed that the app has no blatant
>> infinite loops. Yes, that would block the event loop and prevent
>> anything from running, but if you've done that, you should take Intro
>> to Node 101, or maybe the remedial class...
>>
>> In a production environment, we're concerned about long running events
>> that might be blocking the event loop. If your code is doing database
>> calls, then it's yielding to the event loop. No problem there. But
>> then if you run a bunch of processing on that using synchronous code,
>> and that processing takes longer than whatever threshold you give in
>> the code I posted, then it will tell you. We're not concerned as much
>> about overall request time, because during the time it's processing
>> the request, it's probably yielding. For newbies, yielding means that
>> you perform some action and pass it a callback, and when that action
>> is done, it calls the callback. Users see this all over in node code.
>> That doesn't necessarily mean it yields though...
>>
>> Case scenario: we had a bunch of db calls to load data that would be
>> processed (sorted, organized, transformed, etc) and converted to json
>> and then fed to the client. That db calls yield each time a db call is
>> made. No problem. The processing was all linear programming. Problem:
>> for large data sets it was taking over our threshold. When you have
>> more concurrent requests than the number of instances of node (we're
>> using cluster) then every instance is busy and your server goes
>> unresponsive. BAD news. We had to change some calls to accept a
>> callback, and then it would call the callback inside a
>> process.nextTick(). That made the code async, and the problem
>> disappeared. We could ramp up with hundreds of users and the users
>> with only a little data got served fast, the users with lots of data
>> not quite as fast, but at least they weren't blocking other users.
>>
>> People often misunderstand how to build server-side apps with Node.
>> With async coding in node, you can easily outmatch performance for
>> lots of other environments. With synchronous code in node, you can
>> easily have a dead server. Node is great, but it's oh-so-easy to shoot
>> yourself in the foot. Gotta be really careful about excessive runs of
>> synchronous code.
>>
>> --
>> 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: Event loop blocking. How to detect?

2012-06-06 Thread José F . Romaniello
cool, i think this comment is the exact think I was thinking:
https://github.com/joyent/node/issues/2395#issuecomment-3232185

but configurable..

2012/6/6 Koichi Kobayashi 

> Here is similar proposal:
>
> https://github.com/joyent/node/issues/2395
>
>
> On Wed, 6 Jun 2012 11:42:30 -0300, Jose F. Romaniello <
> jfromanie...@gmail.com> wrote:
>
> > this might sound very stupid,... but wouldn't be useful to have a
> parameter
> > or something to set the max milliseconds a tick can take?
> >
> > node myapp.js --tick-timeout 6
> >
> > this means if you have a while(true), or something than takes more than a
> > minute fail!, raise an exception in the application so you can log it on
> > the process "uncaughException" event. and something like "forever" will
> > restart the process.
> > Maybe there is no way to implement this right now, or maybe there is
> > something like this already...
> >
> > cheers,
> >
> > 2012/6/6 Matt 
> >
> > > This doesn't change the fact that external monitoring is still going
> to be
> > > better.
> > >
> > > On Wed, Jun 6, 2012 at 1:27 AM, Jeff Willden  >wrote:
> > >
> > >> Some readers are not getting the point. When running node in a
> > >> production environment, it is assumed that the app has no blatant
> > >> infinite loops. Yes, that would block the event loop and prevent
> > >> anything from running, but if you've done that, you should take Intro
> > >> to Node 101, or maybe the remedial class...
> > >>
> > >> In a production environment, we're concerned about long running events
> > >> that might be blocking the event loop. If your code is doing database
> > >> calls, then it's yielding to the event loop. No problem there. But
> > >> then if you run a bunch of processing on that using synchronous code,
> > >> and that processing takes longer than whatever threshold you give in
> > >> the code I posted, then it will tell you. We're not concerned as much
> > >> about overall request time, because during the time it's processing
> > >> the request, it's probably yielding. For newbies, yielding means that
> > >> you perform some action and pass it a callback, and when that action
> > >> is done, it calls the callback. Users see this all over in node code.
> > >> That doesn't necessarily mean it yields though...
> > >>
> > >> Case scenario: we had a bunch of db calls to load data that would be
> > >> processed (sorted, organized, transformed, etc) and converted to json
> > >> and then fed to the client. That db calls yield each time a db call is
> > >> made. No problem. The processing was all linear programming. Problem:
> > >> for large data sets it was taking over our threshold. When you have
> > >> more concurrent requests than the number of instances of node (we're
> > >> using cluster) then every instance is busy and your server goes
> > >> unresponsive. BAD news. We had to change some calls to accept a
> > >> callback, and then it would call the callback inside a
> > >> process.nextTick(). That made the code async, and the problem
> > >> disappeared. We could ramp up with hundreds of users and the users
> > >> with only a little data got served fast, the users with lots of data
> > >> not quite as fast, but at least they weren't blocking other users.
> > >>
> > >> People often misunderstand how to build server-side apps with Node.
> > >> With async coding in node, you can easily outmatch performance for
> > >> lots of other environments. With synchronous code in node, you can
> > >> easily have a dead server. Node is great, but it's oh-so-easy to shoot
> > >> yourself in the foot. Gotta be really careful about excessive runs of
> > >> synchronous code.
> > >>
> > >> --
> > >> 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 ema

Re: [nodejs] .bind performance (Was Re: context (thisness) to EventEmitter#on, process.nextTick, etc)

2012-06-08 Thread José F . Romaniello
Interesting sometimes i use bind just for "partial application"

2012/6/9, Tim Caswell :
> FWIW, my experience with .bind on V8 has always been that it's actually
> significantly slower than just creating a closure yourself.  For a
> microbenchmark, see http://jsperf.com/bind-vs-closure
>
>
> Besides the memory overhead of using bind vs calling with call, bind has
> strange semantics.  For example, many developers don't know that you can't
> rebind a function.  It's rather opaque and weird.  I don't *like* working
> with bound functions.  I do it many times anyway because the syntax is
> rather pretty and the performance of that part isn't critical.
>
>
>
> On Fri, Jun 8, 2012 at 7:34 PM, Rick Waldron 
> wrote:
>
>>
>>  On Friday, June 8, 2012 at 8:29 PM, Jimb Esser wrote:
>>
>> Binding more than once is very common
>>
>> The bound function returned by fn.bind cannot be rebound and will
>> silently
>> ignore any attempts to do so.
>>
>>
>>
>> - any code that is written with
>> a closure instead can be written with a static function and a .bind
>> (and, in general, be more efficient, causing less heap pressure).
>>
>> I think you might be misusing terminology. Perhaps you could share a code
>> example that illustrates your claim?
>>
>> Rick
>>
>>
>>
>> But, yeah, the immediate bind vs call was just in response to AJs
>> query, and it's pretty clear there's no reason to do that
>> (unless .bind was magically efficient, which it's not, it's just
>> generally more efficient than a new closure).
>>
>>
>>
>> On Jun 8, 5:22 pm, Rick Waldron  wrote:
>>
>> On Fri, Jun 8, 2012 at 7:23 PM, Jimb Esser  wrote:
>>
>> [Moved to nodejs instead of nodejs-dev since this is of general interest
>> and only tangental to the original request]
>>
>>
>> I've never thought of using .bind instead of .call, but since .bind does
>> allocate something, and .call theoretically doesn't have to, I'd just
>> assume .call is more efficient, though I've learned any performance
>> assumptions about JS are usually incorrect ^_^.
>>
>>
>> Doing a quick jsperf test of the things discussed here:
>> http://jsperf.com/bind-vs-call2
>> Results are... questionable, and I don't put too much stock in
>> micro-tests
>> like this, as the optimizer is good at making them go fast in
>> inconsistent
>> ways.  But, anyway, f.call(o) is way faster than f.bind(o)(), which is
>> not
>> surprising.  Slightly surprising, .bind seems to underperform closures
>> significantly in this case, though (at least on the older version of V8
>> node is using), in real-world apps (at least, ours), I'm pretty certain
>> .bind is generally better... also allocates less memory (although in a
>> micro-test like this V8 likely effectively optimizes out any memory
>> allocations from the no-op closures).
>>
>>
>> This comparison is unbalanced -- when would you ever bind() more then
>> once?
>> The bound function cannot be rebound.  Furthermore, when would you ever
>> bind() and immediately execute? Never - because the correct approach is
>> to
>> use call() when immediate invocation is required. bind() is one shot deal
>> that returns a new bound function to be called later.
>>
>> Rick
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>   - Jimb Esser
>>
>>
>> On Fri, Jun 8, 2012 at 3:14 PM, AJ ONeal  wrote:
>>
>>
>> Interesting. So have you found bind() to be more or less efficient than
>> .call() and or .apply()?
>>
>>
>> AJ ONeal
>>
>>
>> On Fri, Jun 8, 2012 at 3:48 PM, Jimb Esser  wrote:
>>
>>
>> Technically, at least in V8, .bind is a lot lighter weight than an
>> anonymous function.  There are a large number of micro-benchmarks to look
>> at on jsperf.com, but for an actual anecdote, at one point we
>> accidentally required in a module which overrode Function.prototype.bind
>> with something that created an anonymous function (some browser-support
>> code for pre-.bind browsers), and our performance tanked, garbage
>> collection times increased significantly.
>>
>>
>> On Fri, Jun 8, 2012 at 2:25 PM, AJ ONeal  wrote:
>>
>>
>> If I'm not mistaken, bind() has the same technical drawbacks as using
>> an anonymous function (higher memory usage, more garbage collection, and
>> slower says Tim), but it does solve the maintainability / prettiness
>> issue.
>>
>>
>> I just want to point out that Raspberry Pi is now shipping.
>> NodeJS is a very attractive option for development.
>>
>>
>> My own experience with my ARM-based media server has lead me to be a
>> believer in prototypes and leaner code. I can't say that one little anony
>> here and there is going to blow up an application, but I know for a fact
>> that there are significant performance gains when they are avoided.
>>
>>
>> I know it doesn't seem like a big deal now. But one day you may change
>> your mind.
>>
>>
>> AJ ONeal
>>
>>
>> On Fri, Jun 8, 2012 at 2:22 PM, George Stagas wrote:
>>
>>
>> No need to change the API, we have .bind() - use the language
>> features, don't reinvent them.
>>
>>
>> 2012/6/8 Tim Caswell :
>>
>>
>> On Fri, Jun 8, 

Re: [nodejs] Re: The right way of coding nodejs applications: functional or string Object Oriented ?

2012-06-19 Thread José F . Romaniello
I agree with Nuno on this (but I'm a beginner).
I mostly do functional but often I find a places where i prefer an
object abstraction.

And I find that this is mostly the case of the node api, you will find like
a bunch of functions in "fs"... but then things like Stream or the
EventEmitter looks more like objects (classes).

so, I use both but more functional.

2012/6/19 Nuno Job 

> Do functional style if you feel like it, OO if you feel like it.
>
> It's your choice, nodejs lends itself to both.
>
> A lot of good nodejs developers do OO. A lot of good nodejs developers do
> functional style.
>
> Ignore FUD, and all the benchmarks that consistently look at non
> bottlenecks.
> (If you are creating 1 million objects per second you are probably doing
> something else wrong)
>
> Nuno
>
>
> On Thursday, September 29, 2011 8:30:07 AM UTC-7, Giovanni Giorgi wrote:
>>>
>>> Hi all,
>>>   I am new to nodejs, even if I am a 37 super-nerd loving programming
>>> languages.
>>>
>>> I know and love python, java, ruby, erlang, SmallTalk, bash, emacs-lisp
>>> (less then other :-), coffescript, perl, Self and so on
>>>
>>> So I started to play with nodejs, too which was not yet in the "web
>>> framework" collection of mine :)
>>>
>>> I have always OOP in python, Self and SmallTalk.
>>> Making objects is fun.
>>>
>>> But after reading
>>>
>>> https://github.com/**spencertipping/js-in-ten-**minutes
>>>
>>> in particular "5.1 Why new is awful" and "5.2 Why you should use
>>> prototypes", a lot of things in my head went wrong.
>>>
>>> I fear strong-OOP is not the better way of code in JavaScript and in
>>> nodejs in
>>> particular.
>>>
>>> Nodejs is callback-based. So a functional approach is better, and
>>> should I avoid using class
>>> inheritance?
>>>
>>> I like functional approach, but in my little experience it works quite
>>> bad with high dynamic
>>> languages, and javascript oddities seems not a good starting point.
>>>
>>> What is your experience (and suggestions)?
>>>
>>> ---
>>> Gio's Blog http://gioorgi.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] load a module in a sandbox with mocked dependencies

2012-06-20 Thread José F . Romaniello
Hi list, I just started a new small module to load modules in a sandbox
with mocked dependencies  https://github.com/jfromaniello/mockuire (mockuire
= mock*[req]*uire)

It loads the module in a sandbox and will use the mocked dependencies that
you pass on when calling mockuire. If the "mockuired" module requires a
module that is not mocked, it will require the module normally.

every paths should work as a normal require call, relative paths should
work fine.

Since it loads the module in a sandbox, the module under test is not cached.

It solve few problems i have before when writing some unit tests, even if
prefer not mocking anything at the first place for most of my tests.

hope you find it useful, any feedback is welcome.

-- 
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] Wrap functions as streams (pipemaster)

2012-06-23 Thread José F . Romaniello
I started something like this few weeks ago nothing there yet but the
readme file ( readme driven development).

https://github.com/jfromaniello/funstream



El sábado, 23 de junio de 2012, dolphin 278 escribió:

> Thanks for your reply Dominic i am in the middle of implementing those
> functions. I'll use your information. Thanks again.
> -
> Boris Egorov
> skype/gtalk/nickname: dolphin278
> mobile: +7 905 728 1543
>
>
> On Sat, Jun 23, 2012 at 3:24 PM, Dominic Tarr wrote:
>
> I have a collection of functions similar to this here:
>
> https://github.com/dominictarr/event-stream
>
> you need to add `destroy`, and should add `pause` and `resume`.
>
> this may be helpful: https://gist.github.com/2850882
>
> it's my best effort at defining the correct behaviour for streams,
> such that pipe will work correctly.
> it's not official of course, its just constructed from
> reading node/lib/stream.js and so on, and figuring it out.
>
> cheers, Dominic
>
> On Sat, Jun 23, 2012 at 10:23 PM, dolphin 278 
> wrote:
> > Good day
> >
> > I did not found any modules to easily wrap any function to stream
> interface,
> > so i made my own. Point is to have an option to pipe streams to different
> > filters and transformations, without describing stream interface from
> > scratch every time.
> >
> > Usage:
> >>
> >> var FuncWrapper = require('pipemaster').FuncWrapper,
> >> streamFunc;
> >> function asyncExample(x, callback) {
> >>callback(null, x * x); // first argument is an optional error.
> >> }
> >> streamFunc = new FuncWrapper(asyncExample);
> >> streamFunc.write(2);  // streamFunc emits '4'
> >> streamFunc.write(6);  // streamFunc emits '36'
> >
> >
> > There is another class for easy filtering, called StreamFilter for em,
> easy
> > filtering :)
> >>
> >> var StreamFilter = require('pipemaster').StreamFilter,
> >> streamFunc;
> >> function filterAsync(item, callback) {
> >> callback(null, item === 4);
> >> }
> >> streamFunc = new StreamFilter(filterAsync, true);
> >> streamFunc.write(1);
> >> streamFunc.write(4);
> >> streamFunc.write(2);
> >> // streamFunc emits only '4'
> >
> >
> > Installation, as always - npm install pipemaster, github link
> > - https://github.com/dolphin278/pipemaster/
> >
> > Hope it would be helpful for someone :)
> > --
> > Boris Egorov
> > skype/gtalk/nickname: dolphin278
> > mobile: +7 905 728 1543
> >
> > --
> > 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] Wrap functions as streams (pipemaster)

2012-06-23 Thread José F . Romaniello
Excellent Dominic, yes! The idea of reduce ( idea, 0 code) was to make a
readable/writeable stream. For each chunk passed to the reduce, it will
execute the reduce function, when the input stream ends it will the reduce
stream will emit one and only one data event with the value of the
accumulator and it will ends. The example i wrote is totally wrong and
should be


var aFileStream = fs.createReadStream("foo.txt");
aFileStream.pipe(funs.reduce( function (prev, chunk) { return prev +
chunk.match(/o/g).length; }))
 .pipe(funs.map( function (total) { return " total amoun of
'o': " + total; }))
 .pipe(process.stdout);

Not sure if is useful though

-- 
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] Should i use node?

2012-06-24 Thread José F . Romaniello
 I wrote something about this few weeks ago

http://joseoncode.com/2012/05/31/node-dot-js-and-the-beauty-of-working-on-a-platform-that-embrace-opensource/



2012/6/23, Radhames Brito :
> On Sat, Jun 23, 2012 at 1:12 PM, Mark Hahn  wrote:
>
>> >   I dont see node.js growing much
>>
>> You must be blind.  Node is exploding with no end in site.
>>
>>
> Yes I agree Node is exploding, but there needs to be standards, I know
> everyone is running to it but efforts should be unified.
>
> --
> Radhamés Brito
> *Techpark *
> 829 994 1212
> Email:rbr...@techpark.com.do 
>
> --
> 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
>

-- 
Enviado desde mi dispositivo móvil

-- 
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] Should i use node?

2012-06-24 Thread José F . Romaniello
> This can be helped by better organization around community support of
recommended modules. Hopefully this story gets better in the near future.

Recommended by who? Based on what?

I had the chance to assist to a talk that Isaac gave on JsConfAr, about
this.. I cant find his talk online right now but this post looks similar:
http://blog.izs.me/post/23048895912/tacoconf-anarchism

-- 
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] Should i use node?

2012-06-24 Thread José F . Romaniello
I wont use something because the upvoters. I have 2 months working in node
for serious when i need something i search with npm (slow), or google ->
github. Then i look at the github page to see if it does what i want, and
if is not clear i look at the examples folder then at the test folder. If
it does what i want i will use. If it doesnt and i think it should I can
fork it and enhance, or look for some other module.

El domingo, 24 de junio de 2012, Mark Hahn escribió:

> >  Recommended by who? Based on what?
>
> How about one vote per github account?
>
>  --
> 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  'nodejs%2bunsubscr...@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] Testing: best practices

2012-07-02 Thread José F . Romaniello
I  usually use sinon.js  to mock my ajax calls and i
write my asserts against a DOM which is restored for every test... .

2012/7/2 Evgeny Bogdanov 

>
> I don't have a clear answer how it is best to unit test client code that
> has jQuery calls.
> I mock jQuery calls, but it seems a bit of an overkill
> What are your ways of doing/not-doing 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] Re: trying to wrap my head around "promises" - async vs Q

2012-07-02 Thread José F . Romaniello
I saw your slides and I cant agree more with you. The other day I did some
thinking about all the javascript code I have been writing and I came to
this conclussio (bear with me, please):
- for me the problem with CPS (continuation passing style) for asynchronous
code is not the cascade of nested callback. The code gets ugly when you mix
CPS constructs with non-CPS constructs. Think when you have to do something
async while looping something, or when you have to do something async IF
some condition is true, and then something else even when the condition is
not met.
- javascript has ifs, for, and lot of constructs that are non-CPS. In
Clojure and LISPs everything could be CPS, so in this regard we can say is
"better".
-tamejs, iced coffee script, f# (with its async workflows) etc has
constructs to avoid CPS for asynchronous code and one of the best things of
this is that non-CPS IF statements play nice with ... non cps async code.

I wrote an example in my blog about this
http://joseoncode.com/2012/06/24/messing-with-cps-in-js/ where i explore a
way to create a CPS IF statement and it makes the code easier than with the
standar IF statement. Another thing Id like to have is a language with nice
syntax for asynchronous code (as your await example) that compiles down to
LISPish javascript.



El domingo, 1 de julio de 2012, Domenic Denicola escribió:

> I'd like to submit my promises talk for consideration as well :). I agree
> with Mariusz that once you get it you will never go back.
>
>
> http://www.slideshare.net/domenicdenicola/callbacks-promises-and-coroutines-oh-my-the-evolution-of-asynchronicity-in-javascript
>
> On Sunday, July 1, 2012 2:55:05 PM UTC-4, Mariusz Nowak wrote:
>
> @Andy Async is just sugar for control flow written with plain callbacks
> and promises address asynchronicity from very different angle.
> In promises approach asynchronous state is represented with the object, so
> instead of registering single callback, you get the object, which you can
> pass to many different functions, or on which you can listen for value with
> many different listeners. Promises also provide clean separation of success
> and error flows. It's much more powerful than plain callbacks, but also
> takes some time to get familiar with that. Once you get it, you will never
> go back ;-)
> I've once done introduction to promises speech. See
> http://www.medikoo.com/**asynchronous-javascript/
>  (**promises starts at 16 slide)
>
> --
> Mariusz Nowak
> https://github.com/medikoo
> http://twitter.com/medikoo
>
>
> On Sunday, March 25, 2012 10:42:32 AM UTC+2, Andy wrote:
>
> *Note, I am not asking which tool is better, I am simply trying to
> understand the differences.
>
> *I'm trying to wrap my head around promises in node. Right now I'm
> writing all my code in callback soup. I am researching libraries and I
> found async  (duh) but I also found the
> horribly named but seemingly very popular q
> .
>
> What I am trying to figure out is if these libraries are mutually
> exclusive. The async page mentions nothing about "promsies" and instead
> talks about "flow control." But it seems like both libraries are sugar for
> handling async function flow and callbacks. Do they both solve the same
> problem, or can / should they be used together?
>
> Take this example:
>
> async.waterfall([
> function(callback){
> callback(null, 'one', 'two');
> },
> function(arg1, arg2, callback){
> callback(null, 'three');
> },
> function(arg1, callback){
> // arg1 now equals 'three'
> callback(null, 'done');
> }
> ], function (err, result) {
>// result now equals 'done'
> });
>
>
> vs:
>
> Q.call(step1).then(step2).then(step3).then(step4).then(function (value4) {
> // Do something with value4}, function (error) {
> // Handle any error from step1 through step4}).end();
>
>
> Both libraries are doing things in a series, and both are passing their
> results to the next function. Is there really any difference between the
> two results other than Q returning a promise that you can chain to with
> .then?
>
> Is async really just a more versatile q? Or are there reasons to use one
> and the other and they could be used together?
>
> And can you do parallel functions with promises? Or is that not what
> they're used for? (And if not, should you use async + q, or is there too
> much overlap?)
>
>  --
> 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 

-

Re: [nodejs] Re: Testing: best practices

2012-07-03 Thread José F . Romaniello
I started this little thing to load a module in a sandbox where i can swap
the result of a require() call:

https://github.com/jfromaniello/mockuire

it load the module in a sandbox and only the code, so it is not cached and
i dont need to clean up anything.

I didnt need sinon in node.js, but i use it when testing client side code
to mock ajax calls.

2012/7/3 Evgeny Bogdanov 

> Question to sinon users: can it mock the required modules like gently does?
> https://github.com/felixge/node-gently#gentlyhijackrealrequire
>

-- 
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] createReadStream and readDir

2012-07-06 Thread José F . Romaniello
I think this might work for you: https://github.com/isaacs/fstream/

El viernes, 6 de julio de 2012, Julian Gruber escribió:

> Is it possible to create a readStream from readDir? I tried
> createReadStream('.') but directories are not supported there.
>
> Generally, is it possible to build on streams completely for control flow,
> having as few callbacks as possible?
>
> --
> 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  'nodejs%2bunsubscr...@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] createReadStream and readDir

2012-07-06 Thread José F . Romaniello
Yes, i think Fstream emits an Entry event per each file with the stat and
also each Entry is an stream of the file

El viernes, 6 de julio de 2012, Ben Noordhuis escribió:

> On Fri, Jul 6, 2012 at 2:28 PM, Julian Gruber
> > wrote:
> > Is it possible to create a readStream from readDir? I tried
> > createReadStream('.') but directories are not supported there.
> >
> > Generally, is it possible to build on streams completely for control
> flow,
> > having as few callbacks as possible?
>
> Not really. Streams are byte or character oriented, a
> DirectoryReadStream would be record oriented.
>
> --
> 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 practice for defining an interface

2012-07-06 Thread José F . Romaniello
I have seen a lot of tests in node packages like these here:

https://github.com/flatiron/winston/blob/master/test/winston-test.js#L24

assert.isObject, assert.isFunction, etc

I see this as a common practice and i think it is a way to define an
interface close to what a compiler in an static language will do. I have a
lot of respect for the ones that write this kind of tests but I dont see a
lot of value on this.

The only value I can see is that if you broke your "interface" a tests will
fail with "xxx.doY expected to be a function". I write tests for the
behavior only... so if I broke my interface I will see a javascript default
error "OBJECT CALL AS A FUNCTION" or "undefined is not a function".


2012/7/6 Jeff Barczewski 

> A friend of mine, Ken Sipe, once said (regarding statically typed
> languages and compile-time error checking) that compiling is very much like
> running an initial set of tests (that the compiler created instead of the
> developer).
>
> Taking that idea one step forward, it is certainly good to create a
> document which describes the interface and how it is used (with examples)
> or ...
>
> However, Ken also said that tests are like executable intent, meaning you
> describe what should happen, and then you can also execute it to verify
> that it does.
>
> So one might simply *create a set of tests that test out the required
> functionality of your desired interface*, then use that to verify any
> objects that are supposed to be implementations (much like a compile
> check). This is also great if you are having someone else build the actual
> code, once they are done, run the tests against it and if it passes then it
> is implemented correctly.
>
> If your tests are written in a very readable way, then you might not even
> need much other documentation to accompany it, it already has examples of
> how to use, and if the tests describe the functionality then it can be
> fairly easy to read. It's probably good to have a good readme as well, but
> for somethings the tests might be sufficient.
>
>
>
>
>
>
> On Wednesday, 4 July 2012 02:15:56 UTC-5, Dave Horton wrote:
>>
>> Thanks much for the responses.  As a server side guy new to node, I have
>> been trying to weigh in my own head whether some of the things I naturally
>> look around for are better viewed as opportunities to change my thinking to
>> do things in a new, and possibly more effective, way.  (And, no doubt,
>> there is much that I see in the node ecosphere that is quite excitingly
>> better).  In the case of interfaces, though, I do find myself missing the
>> ability to have a java-style kind of way of defining an interface.  The
>> thing I like about java interfaces is that if I design an interface, and
>> someone tries to implement to it their code will break early - at compile
>> time -- if they don't get the API right (actually, their editor will
>> probably just add stubs of the necessary methods for them so they get it
>> right without much researching) .  Surfacing those types of issues early is
>> a good thing, regardless of language.
>>
>> In node, I see a lot of nice documentation written by folks to describe
>> their APIs, which is nice, but on the other hand that type of docs seems
>> much more necessary than in other language.  I also wonder if the lack of
>> interface constructs (or, altneratively, the 100 different ways you could
>> roll your own in JS, which seems true of most things) affects how people
>> write their code.  For instance, I see lots of examples where people expose
>> objects in their modules that use prototypal inheritance to implement a
>> Stream api by inheriting from one of the Stream classes in node; but to me,
>> a Stream is really a set of behaviors/traits that I want my object to
>> implement, and using my one single prototype "bullet" to get it seems less
>> desirable to me than some way of informing the system that my object will
>> implement those behaviors/traits (along with possibly implementing other,
>> unrelated sets of behaviors).  Interfaces let me do that, plus communicate
>> simply and effectively how to build something that plugs in to something
>> else, plus causes things that don't plug in correctly to break early and
>> obviously.
>>
>> Node seems to me to be an environment that allows developers to create
>> moderately complex systems quickly.  And my sense (which could be wrong,
>> I'll admit up front) is that we seem to be in an early days stage where
>> lots of talented individual contributors are at work doing their own thing
>> -- happy to evaluate the ten different ways of doing anything, reading
>> other's code to get a sense of what is going on, etc.  But I wonder if
>> going from moderately complex to really complex systems will require larger
>> teams, and more coordination, and if then we'll find we some formalizations
>> or tools to help people work together.  (All this, of course, is just some
>> random noodlings from someone who is up late and jealous 

Re: [nodejs] Re: Defining a variable, difference btw node REPL and .js/require

2012-07-07 Thread José F . Romaniello
just to add something to the thread, when you are in a file "this" is
equals to "exports"

you can try it as:

echo "console.log(this === exports)" | node

2012/7/7 Angel Java Lopez 

> Thanks!
>
> I usually do in your suggested way, and I'm with you. But in this special
> case, I feel the user of my module could find a bit weird to write
>
> var st = require('simpletags');
>
> st.html(st.head(st.title('...')), st.body(st.h1())
>
> instead
>
> html(head(title('')), body(h1('...'))
>
> in a controlled way (only in its own module). I want to give him/her an
> option. Ruby has it (as an option, too). It's the first time I found I
> needed it in Node.js. Usually, I assert "Ruby ceremony > Javascript/Node.js
> ceremony", but now, I was trapped by this issue.
>
> My best solutions:
>
> a)
> var st = require(...); // and use with st.h1, st.h2...
>
> b)
> require('simpletags').exportsTo(global); // maybe in browser I could
> export to windows directly in the module
>
> c)
> var simpletags = require('simpletags');
> eval(simpletags.exportLocalCode()); // where .exportLocalCode returns a
> String with "var h1 = simpletags.h1; ... "
> c2)
> var st = require('simpletags');
> eval(st.exportLocalCode('st')); // the local variable name 'st' should be
> informed to be used in var ...=  string result
>
> On Sat, Jul 7, 2012 at 10:38 AM, Mariusz Nowak wrote:
>
>> In modules you can achieve the same by assigning function to global: e.g.
>> `global.foo = function () { .. }` it will work same as `this.foo = function
>> () { ... }` in REPL. but I would strongly discourage this, relying on
>> global scope is bad practice.
>>
>> I'd say that unless you're using regular require/export logic to share
>> objects between modules, you're doing something wrong. Try to think just
>> with require/exports and then you should quickly find way home. See how
>> module relations in other packages work.
>>
>> --
>> Mariusz Nowak
>> https://github.com/medikoo
>> http://twitter.com/medikoo
>>
>>
>> On Saturday, July 7, 2012 3:18:51 PM UTC+2, ajlopez wrote:
>>>
>>> Thanks for the suggestion! but...  I missing some part of your
>>> answer.
>>>
>>> I guess I understand the difference btw global, this.property, and var
>>> local. And then, I understand why it not works. What I don't understand is
>>> how to circumvent/solve the problem. I don't know if your answer is:
>>>
>>> a- " you'll get the answers :) " and then, you will know that it's
>>> impossible to solve, or too weird
>>> b-  you'll get the answers :) " and it's possible in this (simple)
>>> way.etc...
>>>
>>> AFAIK, it's "a". Am I right?
>>>
>>> My problem is:
>>>
>>> - module1 requires module2
>>> - I want to use the exposed functions of module2 as they were defined in
>>> module1, using dynamic names. That is, it's not a solution
>>>
>>> var module2 = require('module2');
>>> var Function2 = module2.Function2;
>>>
>>> Usually, I did a bit of experiment at REPL. I found that this works:
>>>
>>> var name = 'Function2';
>>> this[name] = ...
>>>
>>> var obj = new Function2(); // without using this
>>>
>>> BUT it's only works at REPL. So, encouraged by this discovery (I
>>> expected it will not work), I hoped to make it works in other context.
>>>
>>> Now, I understand why it is work in REPL. Notably, in REPL
>>>
>>> this == global
>>>
>>> so it's possible to emulate
>>>
>>> var foo = ...
>>>
>>> with something like (pseudocode)
>>>
>>> name = 'foo'
>>> var [name] = .
>>>
>>> writing
>>>
>>> name = 'foo';
>>> this[name] = ...
>>>
>>> and then foo is available "as if it is" a local var.
>>>
>>> But inside a running .js, this is not equal to global. I was tricked by
>>> REPL ;-)
>>>
>>> So, the better solution I found so far is to put something like this in
>>> module1:
>>> // http://stackoverflow.com/**questions/5625569/include-**
>>> external-js-file-in-node-js-**app
>>>
>>> var fs = require('fs');
>>> var vm = require('vm');
>>>
>>> var includeInThisContext = function(path) {
>>> var code = fs.readFileSync(path);
>>> vm.runInThisContext(code, path);
>>> }.bind(this);
>>>
>>> includeInThisContext(__dirname + '/module2.js');
>>>
>>> console.log(foo); // it's defined
>>>
>>> where module2  define foo:
>>>
>>> foo = {};
>>>
>>> BUT IN MY CASE, module2 doesn't define the functions at its own context:
>>> https://github.com/ajlopez/**SimpleTags/blob/master/lib/**simpletags.js
>>> it uses an array to dynamically define and export functions.  I never
>>> have
>>>
>>> function h1() {
>>> }
>>>
>>> function h2() {
>>> }
>>>
>>> defined at module2 context. And I don't want this. My DSL defines a
>>> function for each HTML tag.
>>>
>>> Now, I want to have these dynamically defined functions from
>>> module2 accessible in outer module1, as they were local to it.
>>>
>>> I could write inside my module,
>>>
>>>  var h1 = ma

  1   2   3   >