[nodejs] Current state of replacements for connect.multipart() - any feedback?

2014-01-25 Thread jed
I've been looking to replace connect.multipart() in my express middleware 
stack now that it's been deprecated, and will be removed in Connect 3.0.

It seems there are a few different takes on replacing this, and I wanted to 
see if anyone's got any feedback or knows something I've missed.

A good solution (as decided upon by Ghost, see 
https://github.com/TryGhost/Ghost/issues/1227) seems to be 
busboy, 
but it looks like switching to this would require a decent rewrite of any 
part of an app that handle file uploads.

As mentioned in this express issue, 
https://github.com/visionmedia/express/issues/1793, connect-multiparty 
seems to be a drop-in replacement for connect.multipart, except the author 
recommends against using it (https://github.com/andrewrk/connect-multiparty). 
Among other issues, it leaves the implementation of cleaning up temp files 
to the developer. The multiparty project itself suggests busboy as a better 
solution, for performance.

Kraken on the other hand implemented formidable for multipart handling: 
https://github.com/paypal/kraken-js/pull/54

I'm interested in any experience or feedback anyone has on this topic, as 
I'm looking to replace express.bodyParser in 
KeystoneJS, 
preferably in a backwards-comptible way.

It would be great to hear an up to date perspective from the community on 
this issue as a whole. Express is a bit of a standard for node.js web 
development, so by default bundled middleware like connect.multipart was 
too. Any ideas on what might emerge as the new standard* for multipart 
upload handling?

Is anyone working on / has implemented a solution to multipart form 
handling recently that I haven't mentioned above?

Thanks,
Jed.

* by standard, I realise there are no standards, just not sure how better 
to put it. I just don't want to implement solution A if another solution B 
is more popular or has better support, which is why I'm looking for 
feedback.

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, 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: HasInstance of v8's FunctionTemplate; how to upgrade code with v0.11 >

2014-01-25 Thread Rod Vagg

Compatibility with V8 in 0.11.3+ is a dogs-breakfast, lots of major changes.

See https://github.com/rvagg/nan also browse through the dependants of NAN 
to find examples of the kinds of things you'll need to change for 0.11 
support while not breaking 0.10 and prior support: 
https://npmjs.org/browse/depended/nan

If you have a specific question, feel free to file an issue on the NAN 
GitHub repo and ask.

The specific problem you're running in to I believe is that your 
`constructor` is probably a Persistent type which are no longer a subclass 
of Handle so are much less useful as an operational type. You need to 
convert back to a Local each time you want to do anything useful with what 
the Persistent is referencing. There is a 
`NanHasInstance(Persistent&, Handle)` that deals 
with this particular case that you should be able to drop in as a 
replacement.

Cheers,

 -- Rod


On Sunday, 26 January 2014 12:02:30 UTC+11, waldensi...@gmail.com wrote:
>
>  Trying to upgrade to v0.11.10 and higher. The HasInstance from v8 looks 
> like it is one of the few unchanged pieces in v8 yet no longer compiles as 
> available. Take code
>
> class Base : public node::ObjectWrap {
> public:
> ...
> Handle  Base::applyTransform(const v8::FunctionCallbackInfo& 
> args)
> {
> HandleScope scope(args.GetIsolate());
> Base* pThis = ObjectWrap::Unwrap(args.This());
>
> if (args.Length()!=1 && 
> !Transformation::constructor->HasInstance(args[0])) {
> ThrowException(Exception::Error(String::New("invalid  
> transformation")));
> return scope.Close(Undefined());
> }
> 
> where the Transformation::constructor is static 
> Persistent constructor;
> HasInstance is in v8.h#FunctionTemplate and implemented in api.cc.
>
> Not understanding why but get compiler error:
> ../src/Base.cc: In static member function ‘static 
> v8::Handlev8::ValueBase::transformed(const v8::FunctionCallbackInfo
> v8::Value&)’:
> ../src/Base.cc:159:57: error: base operand of ‘->’ has non-pointer type 
> ‘v8::Persistent >’
> if (args.Length()!=1 && 
> !Transformation::constructor->HasInstance(args[0])) {
>  

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, 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] Latest version of bootstrap and jquery-1.10.2

2014-01-25 Thread Jeff Schwartz
Try bower 

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, 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] HasInstance of v8's FunctionTemplate; how to upgrade code with v0.11 >

2014-01-25 Thread waldensianspirit
 

Trying to upgrade to v0.11.10 and higher. The HasInstance from v8 looks 
like it is one of the few unchanged pieces in v8 yet no longer compiles as 
available. Take code

class Base : public node::ObjectWrap {
public:
...
Handle  Base::applyTransform(const v8::FunctionCallbackInfo& 
args)
{
HandleScope scope(args.GetIsolate());
Base* pThis = ObjectWrap::Unwrap(args.This());

if (args.Length()!=1 && 
!Transformation::constructor->HasInstance(args[0])) {
ThrowException(Exception::Error(String::New("invalid  
transformation")));
return scope.Close(Undefined());
}

where the Transformation::constructor is static 
Persistent constructor;
HasInstance is in v8.h#FunctionTemplate and implemented in api.cc.

Not understanding why but get compiler error:
../src/Base.cc: In static member function ‘static 
v8::Handlev8::ValueBase::transformed(const v8::FunctionCallbackInfo
v8::Value&)’:
../src/Base.cc:159:57: error: base operand of ‘->’ has non-pointer type 
‘v8::Persistent >’
if (args.Length()!=1 && !Transformation::constructor->HasInstance(args[0])) 
{

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, 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] Latest version of bootstrap and jquery-1.10.2

2014-01-25 Thread Ryan Schmidt
On Jan 23, 2014, at 14:57, kyoukhana  wrote:

> I was looking on NPM and I only saw jQuery 2.x is there a NPM module for 
> 1.10.2.  Also I don't see a module for the latest version of twitter 
> bootstrap on NPM.   Or should I just include them in public/js

I initially looked for bootstrap in npm, before deciding instead to use a cdn 
for it. There’s bootstrapcdn.com specifically for this, but there’s also 
cdnjs.com which offers so much more than just bootstrap.


-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, 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: binding.gyp: Adding a library link, depending on OS?

2014-01-25 Thread mscdex
You can also look at others' gyp files, such as the ones used in node core 
(e.g. node.gyp and common.gypi) as additional references.

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, 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: binding.gyp: Adding a library link, depending on OS?

2014-01-25 Thread mscdex
On Saturday, January 25, 2014 5:29:50 PM UTC-5, Kevin Ingwersen wrote:
>
> How do I specify a library, depending on the OS? Like on Mac, I need to 
> link against -lobjc. But how do I do that only on Mac, and not on Windows? 
>
>
'conditions': [
  [ 'OS=="mac"', {
'link_settings': {
  'libraries': ['-lobjc'],
},
  }],
],

 

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, 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] Build tools

2014-01-25 Thread Ryan Schmidt
…Again, unless you want to support Windows users.


On Jan 24, 2014, at 03:11, Alex Kocharin  wrote:

>  
> There is also shelljs and a few others... yeah. Please, just use make. :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

--- 
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] binding.gyp: Adding a library link, depending on OS?

2014-01-25 Thread Kevin Ingwersen
Hey!

How do I specify a library, depending on the OS? Like on Mac, I need to link 
against -lobjc. But how do I do that only on Mac, and not on Windows?

Kind regards,
Ingwie

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, 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] From Apache to Nodejs.

2014-01-25 Thread Ryan Schmidt
On Jan 24, 2014, at 08:31, Kevin Ingwersen  wrote:

> After numerous ideas of implementing WebSockets via apache, and after having 
> just noticed certain problems with it too, I finally came to the conclusion 
> that I should move my rather big project away from Apache, and use nodejs.
> 
> I just have one BIG problem so far: Headers.
> 
> When I spawn a process with PHP, I get the page I want…but it also shows the 
> raw PHP headers - and if I use res.writeHead(200), the page becomes blank… 
> Here is my code:
> 
> var docroot = "/Applications/MAMP/htdocs/DI";
> var http = require('http');
> var gateway = require('gateway');
> var spawn = require("child_process").spawn;
> var extname = require("path").extname;
> var join = require("path").join;
> var normalize = require("path").normalize;
> var file_exists = require("fs").existsSync;
> 
> var app = http.createServer(function(req, res){
>   res.setHeader("X-DIRunner","0.1");
>   var bin = "php";
>   var index = "index.php";
>   var file = join(docroot, req.url);
>   if(req.url == "/" || fs.statSync(file).isDirectory()) {
>   file += normalize( "/"+index );
>   }
>   console.log("> url: "+req.url+" | ext: "+extname(req.url)+" | file: 
> "+file);
>   switch(extname(req.url)) {
>   case "php": bin = "php"; break;
>   case "njs": bin = "node";break;
>   case "sh":  bin = "bash";break;
>   }
>   if(file_exists(file)) {
>   res.writeHead(200);
>   var php = spawn(bin, [file]);
>   php.stdout.on("data",function(d){ res.write(d); });
>   php.stderr.on("data",function(d){ res.write(d); });
>   php.on("exit", function(code,sig){ res.end(); });
>   } else {
>   res.writeHead(404);
>   res.end("File not found.");
>   }
> }).listen(8080);
> 
> Obviously, its a test code. But, I want to extend upon it more and more.
> As I am using a Yii based website, it needs to fully support PHP.. So in the 
> end, I need to port GET and POST, and also FILES…somehow :/

You’ll probably want to use a different approach. Spawning a new php process 
for each request is going to be slow.

Instead, consider using nginx as your user-facing web server. Install also PHP 
FPM and configure nginx to send your PHP requests there. Install also nodejs 
and write your app to do whatever things you need nodejs to do, and configure 
nginx to send those requests there.


> I tried to use the „gateway“ npm module. Promising, but outdated. It relies 
> on using next();, but that function has been dead since a while now, and is, 
> as far as I know, deprecated.

next() is part of how Express middleware works. Why do you think it’s 
deprecated?


> So if anybody can give me some good hint on how I can port my project to 
> nodejs, please let me know.

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, 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] ES6 and Node.js 1.0

2014-01-25 Thread Alan Hoffmeister
Why the hurry? Pick two: fast, cheap, stable.
--
Att,
Alan Hoffmeister


2014-01-25 Scott González :
> I'm sure node will continue to have releases to track v8 improvements,
> regardless of version numbers.
>
>
> On Sat, Jan 25, 2014 at 1:37 PM, q2dg2b  wrote:
>>
>> Hello.
>>
>> Now it seems v0.12 is "inminent", I would like to ask if there any
>> possibilities of releasing v.1.0 before the end of 2014. In theory, v0.12
>> was last version before v1.0, but ES6 is expected to be formally done and
>> published by the end of this year. This will bring many changes (the
>> hability of manage generators without flags, for instance), so I don't know
>> if someone has thought about the convenience of wait until 2015 to release
>> v1.0, or not.
>>
>> I ask this for knowing what we can expect during this year.
>>
>> Many 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.

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, 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: How to measure proxy-request-time of node-http-proxy?

2014-01-25 Thread Christoph
i see, now it works like expected. thanks a lot!

Am Samstag, 25. Januar 2014 20:30:54 UTC+1 schrieb Tim Dickinson:
>
> This about your cope.
>
> var proxyServer = http.createServer(function (req, res) {
>
> var start_time = new Date().getTime();
>
> proxy.web(req, res);
>
> res.on('finish', function() {
> console.log("The request was proxied in " + (new Date().getTime() 
> - start_time) + "ms");
> });
> });
>
> On Saturday, January 25, 2014 5:40:09 AM UTC-8, Christoph wrote:
>>
>> Hi,
>>
>> i want to measure the amount of time, each proxy-request needs, so i 
>> tried it this way:
>>
>>
>> 
>> var httpProxy = require('http-proxy');
>> var http = require('http');
>>
>> var proxy = new httpProxy.createProxyServer({
>> target: {
>> host: 'localhost',
>> port: 80
>> }
>> });
>>
>> var start_time = 0;
>> var proxyServer = http.createServer(function (req, res) {
>>
>> start_time = new Date().getTime();
>>
>> proxy.web(req, res);
>>
>> res.on('finish', function() {
>> console.log("The request was proxied in " + (new Date().getTime() 
>> - start_time) + "ms");
>> });
>> });
>> proxyServer.listen(3000);
>>
>> 
>>
>> but this does not work correctly, if there are parallel connections to 
>> handle. start_time is over-written on each client-request and not handled 
>> per request.
>>
>> thanks for any advice! :)
>>
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, 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: How to measure proxy-request-time of node-http-proxy?

2014-01-25 Thread Tim Dickinson
This about your cope.

var proxyServer = http.createServer(function (req, res) {

var start_time = new Date().getTime();

proxy.web(req, res);

res.on('finish', function() {
console.log("The request was proxied in " + (new Date().getTime() - 
start_time) + "ms");
});
});

On Saturday, January 25, 2014 5:40:09 AM UTC-8, Christoph wrote:
>
> Hi,
>
> i want to measure the amount of time, each proxy-request needs, so i tried 
> it this way:
>
>
> 
> var httpProxy = require('http-proxy');
> var http = require('http');
>
> var proxy = new httpProxy.createProxyServer({
> target: {
> host: 'localhost',
> port: 80
> }
> });
>
> var start_time = 0;
> var proxyServer = http.createServer(function (req, res) {
>
> start_time = new Date().getTime();
>
> proxy.web(req, res);
>
> res.on('finish', function() {
> console.log("The request was proxied in " + (new Date().getTime() 
> - start_time) + "ms");
> });
> });
> proxyServer.listen(3000);
>
> 
>
> but this does not work correctly, if there are parallel connections to 
> handle. start_time is over-written on each client-request and not handled 
> per request.
>
> thanks for any advice! :)
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, 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: Web Scraping Frameworks for Node.JS? (e.g. like Python's Scrapy)

2014-01-25 Thread Matt
On Fri, Jan 24, 2014 at 5:14 PM, Alexey Petrushin <
alexey.petrus...@gmail.com> wrote:

> > I have no problem using phantom as a child process ...
>
> How do you control it? Does it support commands issued via stout or
> somehow else?
>

Use node-phantom-simple. It gives you full API access.

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, 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] ES6 and Node.js 1.0

2014-01-25 Thread Scott González
I'm sure node will continue to have releases to track v8 improvements,
regardless of version numbers.


On Sat, Jan 25, 2014 at 1:37 PM, q2dg2b  wrote:

> Hello.
>
> Now it seems v0.12 is "inminent", I would like to ask if there any
> possibilities of releasing v.1.0 before the end of 2014. In theory, v0.12
> was last version before v1.0, but ES6 is expected to be formally done and
> published by the end of this year. This will bring many changes (the
> hability of manage generators without flags, for instance), so I don't know
> if someone has thought about the convenience of wait until 2015 to release
> v1.0, or not.
>
> I ask this for knowing what we can expect during this year.
>
> Many 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.


[nodejs] ES6 and Node.js 1.0

2014-01-25 Thread q2dg2b
Hello.

Now it seems v0.12 is "inminent", I would like to ask if there any 
possibilities of releasing v.1.0 before the end of 2014. In theory, v0.12 
was last version before v1.0, but ES6 is expected to be formally done and 
published by the end of this year. This will bring many changes (the 
hability of manage generators without flags, for instance), so I don't know 
if someone has thought about the convenience of wait until 2015 to release 
v1.0, or not.

I ask this for knowing what we can expect during this year.

Many 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] anyone has redis usage boilerplate like a crud model in javascript (example included)

2014-01-25 Thread Simon Doodkin
Does anyone has Redis usage boilerplate like a CRUD model in Javascript.

For eaxmple:
http://forrst.com/posts/How_I_make_models_in_Node_js_using_Redis_as_dat-90W

How do you use Redis to manage users, and maybe like bank accounts?


Please share your Redis usage code.

thanks
Simon

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, 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] Parsing GYP files?

2014-01-25 Thread Aria Stewart
On Thu, Jan 23, 2014 at 03:01:47PM +0100, Kevin Ingwersen wrote:
> Hey!
> 
> Is it possible to parse GYP files in nodejs? JSON.parse fails at the first 
> single-quote x.x

My gyp-load module should be capable of that as of the 0.6.0 release I just 
made. It parses node.gyp with no trouble.

Beware that it currently has a synchronous interface, including file IO, but 
I'll be changing that in future releases.


pgpneatmIsT3R.pgp
Description: PGP signature


[nodejs] Re: A decent client for a node backend...

2014-01-25 Thread Dennis Kane
The idea of implementing client-side data binding is something that really 
appeals to me, and I think it can really spur innovation in the world of 
tech.  So, I  wanted to give each terminal window the ability to have its 
own arbitrarily sophisticated  environment that could be persisted between 
 page loads. 

In normal command line mode, everything is really just treated like a 
string that must  be interpreted based upon the particular command that has 
been invoked. 

Try doing:

$ echo 1 2 3 4 5

And then:

$ echo "1 2 3 4 5"

...there's really no difference between the  two. 

But then you can interact with the terminal's environment object by running 
the "eval" command as such:  

$ eval one=1 

This is much different than saying:

$ eval two="2"

After running both of these commands, you can do this: 

$ env

...in order to see a nicely formatted  representation of the environment in 
which you are running.  You will see that there is indeed a fundamental 
difference in terms of the internal representations of the  variables, 
"one" and "two". 

Now the thing that really makes this stand  apart from, for example, a bash 
environment,  is that you can create arbitrarily sophisticated object 
trees. 

One way to create an object is by using variable names that you've already 
declared like this: 

$ eval myobj={one,two}

This will create a JSON object with the keys  set to "one" and "two", and 
the values set  to the values that you've given them. 

But to start having real fun, you can do  something like this: 

$ eval myobj.childobj={}
$ eval myobj.childobj.which=true

Then you can also make pure arrays with this  kind of notation: 

$ eval arr=[1, "two", myobj, 4, false]

Okay, writing all of these eval's seems  pretty tedious, no?  How about 
running the  command: 

$ evalon

...in order to make the initial "eval"  implicit.  And the commands will 
look like  this: 

> myobituary = "Goodbye cruel world"

You can exit from this mode just by pressing ctrl+c, or simply by typing a 
period into the prompt and pressing enter. 

My motivation for all of the above is simply to allow for easy typed data 
binding between remote machines, whether the machines are clients or 
servers. That is, you can define a data structure in your browser, and then 
have it unambiguously persisted on the serverside, or even in other 
clientside desktops.  

I so far have done some work in  terms of keeping these JSON objects on the 
server as python dict types, and then being able to remotely manipulate 
these objects via xhr POST requests. This will allow for the rapid 
development of  application specific data structures within the browser, 
and then deploying these same structures with just a couple of key strokes 
from the browser's own terminal. 

Give it a try!

On Wednesday, January 22, 2014 8:28:16 AM UTC-5, Dennis Kane wrote:
>
> It has been kind of an obsession for me to create the kind of end-user 
> experience that will really allow node to start actually being put to use. 
>  I've spent pretty much an entire year of full time coding getting this 
> thing ready for prime time.  The only caveat is that you need a Chrome 
> browser, as it crucially depends on the filesystem API.  I won't get into 
> the details of how to user it.  For now, just go there and start clicking 
> around.  As people show interest, I'll start giving instructions.
>
> Where is "there"?
>
> HERE --> http://urdesk.net
>
> urdesk means: "yoUR DESK" and "Uniform Resource DESK".
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, 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] Error compiling NodeJS (v0.10.25) on Debian Wheezy (7.0)

2014-01-25 Thread Alex Kocharin

>  g++: internal compiler error: Killed (program cc1plus)

I believe it's "out of memory" error. Doesn't look like a bug.



25.01.2014, 04:21, "Sam Roberts" :
> On Fri, Jan 24, 2014 at 3:26 PM, Blaine LaFreniere
>  wrote:
>
>>  g++: internal compiler error: Killed (program cc1plus)
>>  Please submit a full bug report,
>>  with preprocessed source if appropriate.
>>  See  for instructions.
>
> ^- gcc might appreciate the bug report, but then again, you have
> an old compiler, they'd probably prefer to know if its reproduceable
> on 4.8.2.
>
> --
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nodejs@googlegroups.com
> To unsubscribe from this group, 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.


[nodejs] Hacking with node.cc

2014-01-25 Thread Kevin Ingwersen
Hello there.
I hope somebody with proper C++ knowledge is here as well, because now I need 
to utilize that knowledge for a moment.

I have hacked my way so far to write - for experimenting - a php interpreter, 
using my ph7 module. I went further, and now integrated that said module into 
the nodejs binary - and now i can use it. So calling ‚./node script.php‘ will 
now pick up _third_party_main.js, which contains statements to run the 
specified file.

However, now I want to go a bit further, and implement a —lang switch, to 
switch between nodejs and ph7. The logic for that is not hard. but i have a 
problem: v8 seems to consume every argument before the script name. So I am now 
lookign at node.cc->node::Start(). I see that they’re somewhat worked with, but 
as I don’t know the v8 and uv init functions very well, I can’t digg where to 
change the way argv is moved into the process object. So, to be specific, I am 
looking at this passage:


  // Hack aroung with the argv pointer. Used for process.title = "blah".
  argv = uv_setup_args(argc, argv);

  // Logic to duplicate argv as Init() modifies arguments
  // that are passed into it.
  char **argv_copy = copy_argv(argc, argv);

  // This needs to run *before* V8::Initialize()
  // Use copy here as to not modify the original argv:
  Init(argc, argv_copy);

  V8::Initialize();
  {
Locker locker;
HandleScope handle_scope;

// Create the one and only Context.
Persistent context = Context::New();
Context::Scope context_scope(context);

// Use original argv, as we're just copying values out of it.
Handle process_l = SetupProcessObject(argc, argv);
v8_typed_array::AttachBindings(context->Global());


I have changed ParseArgs and commented out a few of the switches - such as -e 
and such - to disable them. Now, I just want to push the full argv into the 
process object. But, where and how do I do that??

Kind regards, Ingwie

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, 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] How to measure proxy-request-time of node-http-proxy?

2014-01-25 Thread Christoph
Hi,

i want to measure the amount of time, each proxy-request needs, so i tried 
it this way:


var httpProxy = require('http-proxy');
var http = require('http');

var proxy = new httpProxy.createProxyServer({
target: {
host: 'localhost',
port: 80
}
});

var start_time = 0;
var proxyServer = http.createServer(function (req, res) {

start_time = new Date().getTime();

proxy.web(req, res);

res.on('finish', function() {
console.log("The request was proxied in " + (new Date().getTime() - 
start_time) + "ms");
});
});
proxyServer.listen(3000);


but this does not work correctly, if there are parallel connections to 
handle. start_time is over-written on each client-request and not handled 
per request.

thanks for any advice! :)

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