[nodejs] replacing PHP with node.js
I am in the processing rearchitecting my web site. Currently it is Apache and PHP on the back and Javascript on the client side. Can I just rewrite my php scripts in node and just change the javascript call the node scripts or do I need more infrastructure software? Does apache have a node plugin or how will that work? Thanks Reza -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] GWT and automated test tools
Currently, we have an HTML Javascript UI and use Selenium for automated testing. What automated tools are there for GWT applications? Thanks Reza -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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: GWT and automated test tools
sorry, wrong group. On Wednesday, September 11, 2013 5:28:23 PM UTC-7, Reza Razavipour wrote: > > Currently, we have an HTML Javascript UI and use Selenium for automated > testing. > > What automated tools are there for GWT applications? > > > Thanks > Reza > > > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] node.js and front end JS code
I want it to return helloworld.html, the filename itself. Can it do that? On Thursday, September 12, 2013 9:34:15 AM UTC-7, Mark Hahn wrote: > > Node is usually an http server like any other. It returns whatever > response you want. The contents of a file containing Hello world HTML > text is a good example. > > > On Thu, Sep 12, 2013 at 9:01 AM, Reza Razavipour > > > wrote: > >> I am not understanding the data flow from the client side JS and back end >> node.js code. >> >> So I am developing a web app, my first one ever :) >> >> Here is how I am envisioning it, the client is browser based, one URL >> only... >> >> I have a node script that is my web server, index.js, starts listening on >> . I do not want this script to return HTML text, does it not have to >> return a HTML filename and not the content? >> >> I thought that UI representation and details are done in a file, HTML and >> javascript. That being the case, the node should return the name of that >> file. >> >> Am I not understanding this correctly? >> >> As far as the code running on the server, we should have a web server, I >> am creating a very light weight one with node itself. The other piece is >> business logic, I am doing that in various node scripts. No knowledge of >> HTML file details cooked into node code. >> >> All of the example I see Hello world HTML text getting send back for the >> first page. I want to send that index.html. >> >> How does one do that? or I am missing the spirit of node? >> >> >> -- >> -- >> Job Board: http://jobs.nodejs.org/ >> Posting guidelines: >> https://github.com/joyent/node/wiki/Mailing-List-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.
Re: [nodejs] node.js and front end JS code
thank you for your reply. At this point I am trying to validate my assumptions and my understanding of the big picture and data flow. On Thursday, September 12, 2013 11:21:23 AM UTC-7, Mark Hahn wrote: > > change `res.end('Hello World\n'` to > > fs.readFile( yourFilePath, 'utf8', function(err, data) { res.end(data); > } ); > > You need to study up on node programming. If you don't know how to do > this you are going to have a hard time doing anything else in node. > > > > On Thu, Sep 12, 2013 at 11:15 AM, Reza Razavipour > > > wrote: > >> I want the browser to display the content of the HTML page and not the >> name. >> >> >> >> On Thursday, September 12, 2013 11:03:40 AM UTC-7, Mark Hahn wrote: >>> >>> correction: Change it to `res.end(MyFileName + '\n');` where MyFileName >>> contains the name of the file you want. >>> >>> BTW, I have no idea why you want to return a file name. You will just >>> see that name on your browser page. >>> >>> >>> On Thu, Sep 12, 2013 at 11:01 AM, Mark Hahn wrote: >>> >>>> Just use the http server example on the node front page and change >>>> `res.end('Hello World\n'` to `res.end('MyFileName\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 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.
Re: [nodejs] node.js and front end JS code
I want the browser to display the content of the HTML page and not the name. On Thursday, September 12, 2013 11:03:40 AM UTC-7, Mark Hahn wrote: > > correction: Change it to `res.end(MyFileName + '\n');` where MyFileName > contains the name of the file you want. > > BTW, I have no idea why you want to return a file name. You will just see > that name on your browser page. > > > On Thu, Sep 12, 2013 at 11:01 AM, Mark Hahn > > wrote: > >> Just use the http server example on the node front page and change >> `res.end('Hello World\n'` to `res.end('MyFileName\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 --- 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] node.js and front end JS code
I am not understanding the data flow from the client side JS and back end node.js code. So I am developing a web app, my first one ever :) Here is how I am envisioning it, the client is browser based, one URL only... I have a node script that is my web server, index.js, starts listening on . I do not want this script to return HTML text, does it not have to return a HTML filename and not the content? I thought that UI representation and details are done in a file, HTML and javascript. That being the case, the node should return the name of that file. Am I not understanding this correctly? As far as the code running on the server, we should have a web server, I am creating a very light weight one with node itself. The other piece is business logic, I am doing that in various node scripts. No knowledge of HTML file details cooked into node code. All of the example I see Hello world HTML text getting send back for the first page. I want to send that index.html. How does one do that? or I am missing the spirit of node? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] node.js only web site
Is it possible to service a web site with node.js only or do I have to have a web server of sort such as express.js? Here is what I am trying to do. I have a web application, HTML and javascript only on the client side. It is all in one URL... like gmail like... I have my index.html page, my login page. I have an index.js that is my web server running on 8080. It reads the index.html page and sends it to the browser. Great so far. Now on the form, the user puts in username and password and presses login button, the javascript needs to call a node script, let's call it login.js. It will return a JSON saying success or failure. So do I just create the login.js in the same directory as the index.js and I am done? or do I need more framework/plumbing for the javascript to call other node scripts? I do not have any routing since it is all one page. Correct? Reza -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] npm install soap errors
I need to make soap calls from my node scripts and came across milewise/node-soap. As the github page says, I run npm install soap and I get a slew of errors and not sure what the cause is or how to overcome it. sudo npm install soap npm http GET https://registry.npmjs.org/soap npm http 304 https://registry.npmjs.org/soap npm http GET https://registry.npmjs.org/node-expat npm http GET https://registry.npmjs.org/request npm http 304 https://registry.npmjs.org/node-expat npm http 304 https://registry.npmjs.org/request npm http GET https://registry.npmjs.org/qs npm http GET https://registry.npmjs.org/json-stringify-safe npm http GET https://registry.npmjs.org/forever-agent npm http GET https://registry.npmjs.org/tunnel-agent npm http GET https://registry.npmjs.org/http-signature npm http GET https://registry.npmjs.org/hawk npm http GET https://registry.npmjs.org/oauth-sign npm http GET https://registry.npmjs.org/aws-sign npm http GET https://registry.npmjs.org/cookie-jar npm http GET https://registry.npmjs.org/node-uuid npm http GET https://registry.npmjs.org/mime npm http GET https://registry.npmjs.org/form-data > node-expat@2.0.0 install /Users/rrazavipour-lp/node_modules/soap/node_modules/node-expat > node-gyp rebuild npm http 304 https://registry.npmjs.org/json-stringify-safe npm http 304 https://registry.npmjs.org/tunnel-agent npm http GET https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.3.0.tgz npm http 304 https://registry.npmjs.org/qs npm http 304 https://registry.npmjs.org/hawk npm http 304 https://registry.npmjs.org/http-signature npm http 304 https://registry.npmjs.org/oauth-sign npm http 304 https://registry.npmjs.org/forever-agent npm http GET https://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz npm http GET https://registry.npmjs.org/hawk/-/hawk-1.0.0.tgz npm http GET https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.3.0.tgz npm http 304 https://registry.npmjs.org/aws-sign npm http 304 https://registry.npmjs.org/node-uuid npm http 304 https://registry.npmjs.org/cookie-jar npm http 304 https://registry.npmjs.org/mime npm http 304 https://registry.npmjs.org/form-data npm http GET https://registry.npmjs.org/cookie-jar/-/cookie-jar-0.3.0.tgz npm http GET https://registry.npmjs.org/mime/-/mime-1.2.11.tgz gyp ERR! build error gyp ERR! stack Error: not found: make gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:43:28) gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:46:29) gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/which.js:57:16 gyp ERR! stack at Object.oncomplete (fs.js:107:15) gyp ERR! System Darwin 12.3.0 gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/rrazavipour-lp/node_modules/soap/node_modules/node-expat gyp ERR! node -v v0.10.13 gyp ERR! node-gyp -v v0.10.2 gyp ERR! not ok unbuild node-expat@2.0.0 unbuild soap@0.2.7 npm ERR! weird error 1 npm http 200 https://registry.npmjs.org/hawk/-/hawk-1.0.0.tgz npm http 200 https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.3.0.tgz npm http 200 https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.3.0.tgz npm http 200 https://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz unbuild request@2.27.0 npm http 200 https://registry.npmjs.org/cookie-jar/-/cookie-jar-0.3.0.tgz npm http 200 https://registry.npmjs.org/mime/-/mime-1.2.11.tgz npm ERR! not ok code 0 Rezas-MacBook-Pro:node_modules rrazavipour-lp$ Any ideas on this is very much appreciated. Reza -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] wsdl file and node.js
Thanks to all who helped me get milewise/node-soap compiled and installed :) Now I adding creating a client from the wsdl file and I get the following error: TypeError: Cannot call method 'GetGeoIP' of undefined at exports.list (/Users/rrazavipour-lp/Documents/workspace/Astute/routes/user.js:25:15) at options (/Users/rrazavipour-lp/node_modules/soap/lib/soap.js:46:9) at endpoint (/Users/rrazavipour-lp/node_modules/soap/lib/soap.js:30:24) at exports.open_wsdl (/Users/rrazavipour-lp/node_modules/soap/lib/wsdl.js:981:17) at Request._callback (/Users/rrazavipour-lp/node_modules/soap/lib/http.js:46:13) at Request.init.self.callback (/Users/rrazavipour-lp/node_modules/soap/node_modules/request/request.js:129:22) at Request.EventEmitter.emit (events.js:117:20) at ClientRequest.Request.init.self.clientErrorHandler (/Users/rrazavipour-lp/node_modules/soap/node_modules/request/request.js:239:10) at ClientRequest.EventEmitter.emit (events.js:95:17) at Socket.socketErrorListener (http.js:1528:9) the WSDL has: and my code is ultra simple... *var* soap = require('soap'); *var* url = 'http://http://www.webservicex.net/geoipservice.asmx?WSDL'; *var* args = {name: 'value'}; soap.createClient(url, *function*(err, client) { client.GetGeoIP(args, *function*(err, result) { console.log(result); }); }); What am I missing? Thanks Reza -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] wsdl file and node.js
changed the code and implemented your suggestions: *var* soap = require('soap'); *var* url = 'http://www.webservicex.net/stockquote.asmx?WSDL'; *var* args = { symbol : 'AMZN' }; soap.createClient(url, *function*(err, client) { client.GetQuote(args, *function*(err, result) { *if* (err) { console.log(err); *return*; } console.log(result); }); }); and in the console all i see is { GetQuoteResult: [ 'exception' ] } Thoughts? Reza On Tuesday, September 17, 2013 2:15:41 PM UTC-7, Jerome Hwang wrote: > > seems like soap.createClient(url, *function*(err, client) returns null > for client > > you should check the "err" as Angel said, so you can make sure that the > call was successful > > > On Tue, Sep 17, 2013 at 3:00 PM, Angel Java Lopez > > > wrote: > >> Ummm... first suggestion >> >> soap.createClient(url, *function*(err, client) { >> >> if (err) { >> >>console.log(err); >> >>return; >> >> } >> >> client.GetGeoIP(args, *function*(err, result) { >> >> console.log(result); >> >> }); >> >> }); >> >> >> On Tue, Sep 17, 2013 at 3:35 PM, Reza Razavipour >> >> > wrote: >> >>> Thanks to all who helped me get milewise/node-soap compiled and >>> installed :) >>> >>> Now I adding creating a client from the wsdl file and I get the >>> following error: >>> >>> TypeError: Cannot call method 'GetGeoIP' of undefined >>> >>> at exports.list >>> (/Users/rrazavipour-lp/Documents/workspace/Astute/routes/user.js:25:15) >>> >>> at options (/Users/rrazavipour-lp/node_modules/soap/lib/soap.js:46:9) >>> >>> at endpoint >>> (/Users/rrazavipour-lp/node_modules/soap/lib/soap.js:30:24) >>> >>> at exports.open_wsdl >>> (/Users/rrazavipour-lp/node_modules/soap/lib/wsdl.js:981:17) >>> >>> at Request._callback >>> (/Users/rrazavipour-lp/node_modules/soap/lib/http.js:46:13) >>> >>> at Request.init.self.callback >>> (/Users/rrazavipour-lp/node_modules/soap/node_modules/request/request.js:129:22) >>> >>> at Request.EventEmitter.emit (events.js:117:20) >>> >>> at ClientRequest.Request.init.self.clientErrorHandler >>> (/Users/rrazavipour-lp/node_modules/soap/node_modules/request/request.js:239:10) >>> >>> at ClientRequest.EventEmitter.emit (events.js:95:17) >>> at Socket.socketErrorListener (http.js:1528:9) >>> >>> the WSDL has: >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> and my code is ultra simple... >>> >>> *var* soap = require('soap'); >>> >>> *var* url = 'http://http://www.webservicex.net/geoipservice.asmx?WSDL' >>> ; >>> >>> *var* args = {name: 'value'}; >>> >>> soap.createClient(url, *function*(err, client) { >>> >>> client.GetGeoIP(args, *function*(err, result) { >>> >>> console.log(result); >>> >>> }); >>> >>> }); >>> >>> >>> What am I missing? >>> >>> Thanks >>> >>> Reza >>> >>> >>> -- >>> -- >>> Job Board: http://jobs.nodejs.org/ >>> Posting guidelines: >>> https://github.com/joyent/node/wiki/Mailing-List-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-Guid
[nodejs] Re: wsdl file and node.js
if I change the wsdl function to some invalid, I get an exception about a bad function so the GetQuote is correct and the result, not the error, is GetQuoteResult [ exception]. Any ideas? I am really stumped. On Tuesday, September 17, 2013 11:35:52 AM UTC-7, Reza Razavipour wrote: > > Thanks to all who helped me get milewise/node-soap compiled and installed > :) > > Now I adding creating a client from the wsdl file and I get the following > error: > > TypeError: Cannot call method 'GetGeoIP' of undefined > > at exports.list > (/Users/rrazavipour-lp/Documents/workspace/Astute/routes/user.js:25:15) > > at options (/Users/rrazavipour-lp/node_modules/soap/lib/soap.js:46:9) > > at endpoint (/Users/rrazavipour-lp/node_modules/soap/lib/soap.js:30:24) > > at exports.open_wsdl > (/Users/rrazavipour-lp/node_modules/soap/lib/wsdl.js:981:17) > > at Request._callback > (/Users/rrazavipour-lp/node_modules/soap/lib/http.js:46:13) > > at Request.init.self.callback > (/Users/rrazavipour-lp/node_modules/soap/node_modules/request/request.js:129:22) > > at Request.EventEmitter.emit (events.js:117:20) > > at ClientRequest.Request.init.self.clientErrorHandler > (/Users/rrazavipour-lp/node_modules/soap/node_modules/request/request.js:239:10) > > at ClientRequest.EventEmitter.emit (events.js:95:17) > at Socket.socketErrorListener (http.js:1528:9) > > the WSDL has: > > > > > > > > > > > and my code is ultra simple... > > *var* soap = require('soap'); > > *var* url = 'http://http://www.webservicex.net/geoipservice.asmx?WSDL'; > > *var* args = {name: 'value'}; > > soap.createClient(url, *function*(err, client) { > > client.GetGeoIP(args, *function*(err, result) { > > console.log(result); > > }); > > }); > > > What am I missing? > > Thanks > > Reza > > > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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: wsdl file and node.js
I use SOAPUI, a commercial product and it works fine, the return is as expected... So the server is up, the function is correct and works... On Wednesday, September 18, 2013 5:24:59 PM UTC-7, ryandesign wrote: > > > On Sep 18, 2013, at 18:28, Reza Razavipour wrote: > > > if I change the wsdl function to some invalid, I get an exception about > a bad function > > so the GetQuote is correct and the result, not the error, is > > GetQuoteResult [ exception]. > > > > Any ideas? I am really stumped. > > Does it work if you try to access this service using a different SOAP > implementation -- one that doesn't use node, for example? If it doesn't > work there either, then perhaps there's a misunderstanding about how to use > this service, or the service is broken. You could contact the providers of > the service. > > > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] node.js and promise
I am a fairly new to javaScript and node.js both. I am trying to wrap my head around promises and I am having a hard time. I am looking for a very simple tutorial/video on this topic and having little success. Is there a reference that can be recommended? A before and after code snippet can be a good starting position. Reza -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] promise and syntax error
can someone explain what is the problem with the following code? I get a syntax error: readdir(__dirname, files).then( function(ob) { console.log ('success'); }, function(error) { console.log('messed up'); }); readdir(__dirname, files).then( ^ TypeError: Cannot call method 'then' of undefined at exports.list.files (/Users/-lp/Documents/workspace//routes/promise.js:22:32) at Object.oncomplete (fs.js:107:15) -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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.js and promise
we all of this I still can not figure out how to take an async function and change it from callback to a promise. 1. Do I have to declare a promise before I can call a 'then' on it? Every time I do not and call a then on an async function, I get a syntax error. On Friday, October 18, 2013 3:11:47 PM UTC-7, Reza Razavipour wrote: > > I am a fairly new to javaScript and node.js both. > > I am trying to wrap my head around promises and I am having a hard time. I > am looking for a very simple tutorial/video on this topic and having little > success. > > Is there a reference that can be recommended? A before and after code > snippet can be a good starting position. > > Reza > > > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] node.js and promise
Let us use an example: var q = require('q'); var myAsyncFunction = function(err, result) { if (err) console.log("We got an error"); console.log("Success"); }; myAsyncFunction().then(function () { console.log("promise is working"); }); myAsyncFunction().then(function () { console.log("it really worked"); }); ^ TypeError: Cannot call method 'then' of undefined How do I turn myAsyncFunction into a promise? On Monday, October 21, 2013 10:58:34 AM UTC-7, Mariusz Nowak wrote: > > > On 21 paź 2013, at 19:52, Reza Razavipour > > wrote: > > we all of this I still can not figure out how to take an async function > and change it from callback to a promise. > > > > Many libraries provide it's own utils for that, just check their > documentation: > > https://github.com/kriskowal/q#adapting-node > > https://github.com/medikoo/deferred#promisify---working-with-asynchronous-functions-as-we-know-them-from-nodejs > > https://github.com/petkaantonov/bluebird/blob/master/API.md#promisepromisifyfunction-nodefunction--dynamic-receiver---function > > > > 1. Do I have to declare a promise before I can call a 'then' on it? Every > time I do not and call a then on an async function, I get a syntax error. > > > > On Friday, October 18, 2013 3:11:47 PM UTC-7, Reza Razavipour wrote: >> >> I am a fairly new to javaScript and node.js both. >> >> I am trying to wrap my head around promises and I am having a hard time. >> I am looking for a very simple tutorial/video on this topic and having >> little success. >> >> Is there a reference that can be recommended? A before and after code >> snippet can be a good starting position. >> >> Reza >> >> >> > -- > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-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 a topic in the > Google Groups "nodejs" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/nodejs/Fx_SjgkXvKU/unsubscribe. > To unsubscribe from this group and all its topics, 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.
Re: [nodejs] node.js and promise
wonderful... thank you. and in q, what would that look like? Regards, Reza On Mon, Oct 21, 2013 at 1:09 PM, Mariusz Nowak wrote: > var promisify = require('deferred').promisify; > var myAsyncFunctionPromiseVersion = promisify(myAsyncFunction); > > myAsyncFunctionPromiseVersion().then(function () { console.log("it > works!"); }); > > On 21 paź 2013, at 21:57, Reza Razavipour > wrote: > > Let us use an example: > > > > var q = require('q'); > > var myAsyncFunction = function(err, result) { > > if (err) > > console.log("We got an error"); > > > > console.log("Success"); > > }; > > myAsyncFunction().then(function () { console.log("promise is working"); > }); > > > myAsyncFunction().then(function () { console.log("it really worked"); }); > > ^ > > TypeError: Cannot call method 'then' of undefined > > > How do I turn myAsyncFunction into a promise? > > > > On Monday, October 21, 2013 10:58:34 AM UTC-7, Mariusz Nowak wrote: >> >> >> On 21 paź 2013, at 19:52, Reza Razavipour wrote: >> >> we all of this I still can not figure out how to take an async function >> and change it from callback to a promise. >> >> >> >> Many libraries provide it's own utils for that, just check their >> documentation: >> >> https://github.com/kriskowal/**q#adapting-node<https://github.com/kriskowal/q#adapting-node> >> https://github.com/medikoo/**deferred#promisify---working-** >> with-asynchronous-functions-**as-we-know-them-from-nodejs<https://github.com/medikoo/deferred#promisify---working-with-asynchronous-functions-as-we-know-them-from-nodejs> >> https://github.com/**petkaantonov/bluebird/blob/**master/API.md#** >> promisepromisifyfunction-**nodefunction--dynamic-**receiver---function<https://github.com/petkaantonov/bluebird/blob/master/API.md#promisepromisifyfunction-nodefunction--dynamic-receiver---function> >> >> >> >> 1. Do I have to declare a promise before I can call a 'then' on it? Every >> time I do not and call a then on an async function, I get a syntax error. >> >> >> >> On Friday, October 18, 2013 3:11:47 PM UTC-7, Reza Razavipour wrote: >>> >>> I am a fairly new to javaScript and node.js both. >>> >>> I am trying to wrap my head around promises and I am having a hard time. >>> I am looking for a very simple tutorial/video on this topic and having >>> little success. >>> >>> Is there a reference that can be recommended? A before and after code >>> snippet can be a good starting position. >>> >>> Reza >>> >>> >>> >> -- >> -- >> 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> >> >> --- >> You received this message because you are subscribed to a topic in the >> Google Groups "nodejs" group. >> To unsubscribe from this topic, visit https://groups.google.com/d/** >> topic/nodejs/Fx_SjgkXvKU/**unsubscribe<https://groups.google.com/d/topic/nodejs/Fx_SjgkXvKU/unsubscribe> >> . >> To unsubscribe from this group and all its topics, send an email to >> nodejs+un...@**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 a topic in the > Googl
[nodejs] Re: node.js and promise
and what would that look like in q? Is it Q.nfcall ? On Friday, October 18, 2013 3:11:47 PM UTC-7, Reza Razavipour wrote: > > I am a fairly new to javaScript and node.js both. > > I am trying to wrap my head around promises and I am having a hard time. I > am looking for a very simple tutorial/video on this topic and having little > success. > > Is there a reference that can be recommended? A before and after code > snippet can be a good starting position. > > Reza > > > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] node.soap client gettings [Error: DEPTH_ZERO_SELF_SIGNED_CERT] error
I have a node app using the soap module, node-soap. I am creating a soap client using a URL. On the mentioned URL, there is a self signed certificate and it is causing a [Error: DEPTH_ZERO_SELF_SIGNED_CERT]. I am not finding much on this but is there is any setting I can tweak for this client to get around this error? My code is the following: var url3 = "https://172.31.19.39/MgmtServer.wsdl";; var args3 = { "user": "admin-priv", "password":"password"}; soap.createClient(url3, function(err, client) { if (err) { console.error(err); return; } console.log(client.describe().MgmtServer.MgmtServer.mgmtValidatePassword); client.MgmtServer.MgmtServer.mgmtValidatePassword(args3, function(err, result) { if (err) { console.error(err); return; } console.log(result); });}); the output is [Error: DEPTH_ZERO_SELF_SIGNED_CERT] [Error: DEPTH_ZERO_SELF_SIGNED_CERT] Any way to deal with this? the certificate is a valid, not expired, self signed certificate -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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.soap client gettings [Error: DEPTH_ZERO_SELF_SIGNED_CERT] error
Added process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; now I get past that error, I get the client.describe and the client call fails. The code is var url3 = "https://172.31.19.39/MgmtServer.wsdl";; var args3 = { "user": "admin-priv", "password":"password"}; soap.createClient(url3, function(err, client) { if (err) { console.error(err); return; } console.log(client.describe().MgmtServer.MgmtServer.mgmtValidatePassword); client.MgmtServer.MgmtServer.mgmtValidatePassword(args3, function(err, result) { if (err) { console.error(err); return; } and the output is now { input: { user: 'xsd:string', password: 'xsd:string' }, output: { rsp: { nsName: 'complexType', namespace: 'ns', name: 'complexType', children: [Object], xmlns: 'urn:MgmtServer', '$name': 'MGMT-RESPONSE-S' } } } { [Error: connect ECONNREFUSED] code: 'ECONNREFUSED', errno: 'ECONNREFUSED', syscall: 'connect' } { [Error: connect ECONNREFUSED] code: 'ECONNREFUSED', errno: 'ECONNREFUSED', syscall: 'connect' } not sure where the ECONNREFUSED is caused by. Thoughts on this? On Thursday, October 31, 2013 9:21:08 AM UTC-7, Reza Razavipour wrote: > > I have a node app using the soap module, node-soap. I am creating a soap > client using a URL. On the mentioned URL, there is a self signed > certificate and it is causing a [Error: DEPTH_ZERO_SELF_SIGNED_CERT]. I > am not finding much on this but is there is any setting I can tweak for > this client to get around this error? > > My code is the following: > > var url3 = "https://172.31.19.39/MgmtServer.wsdl";; > var args3 = { "user": "admin-priv", "password":"password"}; > soap.createClient(url3, function(err, client) { > > if (err) { > console.error(err); > return; > } > > console.log(client.describe().MgmtServer.MgmtServer.mgmtValidatePassword); > client.MgmtServer.MgmtServer.mgmtValidatePassword(args3, function(err, > result) { > > if (err) { > console.error(err); > return; > } > > console.log(result); > });}); > > the output is [Error: DEPTH_ZERO_SELF_SIGNED_CERT] [Error: > DEPTH_ZERO_SELF_SIGNED_CERT] > > Any way to deal with this? the certificate is a valid, not expired, self > signed certificate > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] soap module for node
I have been evaluating soap packages for node and was very happy using node-soap. I am running into an issue, have opened one for it in github. It is either a bug or not but am getting functions that are getting called with wrong namespaces... What other node packages have you all used and your feedback is very much appreciated. -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] soap module for node
please explain how i can run with my own modified version of the node-soap module or any open source module for that matter. so i download the source, make changes, what comes next? how do i start using it? On Monday, November 11, 2013 2:55:40 PM UTC-8, 3rdEden wrote: > > You could always consider fixing the bug, and opening a pull request for > it. It’s open source after all. > > On Monday 11 November 2013 at 23:22, Reza Razavipour wrote: > > I have been evaluating soap packages for node and was very happy using > node-soap. I am running into an issue, have opened one for it in github. It > is either a bug or not but am getting functions that are getting called > with wrong namespaces... > > What other node packages have you all used and your feedback is very much > appreciated. > > > -- > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-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.
Re: [nodejs] soap module for node
m question is how to run with the code with my changes? do I just add the files to my project? I am very new to node... On Monday, November 11, 2013 3:04:26 PM UTC-8, Jeremy wrote: > > You would create a fork of the repository to your own Git Repository, make > the fix in your version, and then use that git path as your dependency ( > http://github.com/...//node-soap.git) > > Also you should submit your fork as a PULL request back to fix the defect. > > > On Mon, Nov 11, 2013 at 5:01 PM, Reza Razavipour > > > wrote: > >> please explain how i can run with my own modified version of the >> node-soap module or any open source module for that matter. >> >> so i download the source, make changes, what comes next? how do i start >> using it? >> >> >> On Monday, November 11, 2013 2:55:40 PM UTC-8, 3rdEden wrote: >> >>> You could always consider fixing the bug, and opening a pull request >>> for it. It’s open source after all. >>> >>> On Monday 11 November 2013 at 23:22, Reza Razavipour wrote: >>> >>> I have been evaluating soap packages for node and was very happy using >>> node-soap. I am running into an issue, have opened one for it in github. It >>> is either a bug or not but am getting functions that are getting called >>> with wrong namespaces... >>> >>> What other node packages have you all used and your feedback is very >>> much appreciated. >>> >>> >>> -- >>> -- >>> Job Board: http://jobs.nodejs.org/ >>> Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List- >>> 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 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.
[nodejs] how to get a console output to show up (from the request package)
Still fairly new to node.js !!! I am using node-soap and it uses the request package. In index.js which is part of the request package, I see this line request.debug = process.env.NODE_DEBUG && /request/ .test(process.env.NODE_DEBUG) how do I make sure the second part is true, /request/.test(process.env.NODE_DEBUG that is? This is how they are testing if something gets logged to the console or not. Any ideas? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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 get a console output to show up (from the request package)
thanks for the response. How do I do that in the code itself? and how do I do multiple ones? lets say debugging for http and request and xyz package. On Thursday, November 14, 2013 10:17:53 AM UTC-8, José F. Romaniello wrote: > > it seems to be matching a regular expression, NODE_DEBUG should contain > the string "request". > > So, you can run your application as follows: > > NODE_DEBUG=request node your_app.js > > > 2013/11/14 Reza Razavipour > > >> Still fairly new to node.js !!! >> >> I am using node-soap and it uses the request package. >> >> In index.js which is part of the request package, I see this line >> >> request.debug = process.env.NODE_DEBUG && /request/ >> .test(process.env.NODE_DEBUG) >> >> how do I make sure the second part is true, >> /request/.test(process.env.NODE_DEBUG >> that is? >> >> This is how they are testing if something gets logged to the console or >> not. >> >> Any ideas? >> >> -- >> -- >> Job Board: http://jobs.nodejs.org/ >> Posting guidelines: >> https://github.com/joyent/node/wiki/Mailing-List-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.
[nodejs] syntax error is node-soap (debug) script when NODE_DEBUG is set
Just learned how to use the NODE_DEBUG env settings. Now I get a syntax error in ./node_modules/soap/node_modules/request/lib/debug.js module.exports = function debug () { if (/\brequest\b/.test(process.env.NODE_DEBUG)) console.error('REQUEST %s', util.format.apply(util, arguments)) } ReferenceError: util is not defined Any ideas what the issue might be? Does not look like this code can ever work if the NODE_DEBUG is set correctly. Thoughts? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] request package syntax error with NODE_DEBUG defined
I just tried the latest request package and it HAS the same syntax error. On Thursday, November 14, 2013 11:10:27 AM UTC-8, Reza Razavipour wrote: > > Just learned how to use the NODE_DEBUG env settings. Now I get a syntax > error in > > ./node_modules/soap/node_modules/request/lib/debug.js > > module.exports = > function debug () { > if (/\brequest\b/.test(process.env.NODE_DEBUG)) > console.error('REQUEST %s', util.format.apply(util, arguments)) > } > > ReferenceError: util is not defined > > > Any ideas what the issue might be? Does not look like this code can ever > work if the NODE_DEBUG is set correctly. > > > Thoughts? > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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: request package syntax error with NODE_DEBUG defined
it turns out to be a bug, that was fixed but never committed. https://github.com/mikeal/request/commit/b8cf8743b66d8eee4048561a7d81659f053393c8 On Thursday, November 14, 2013 11:32:54 AM UTC-8, Reza Razavipour wrote: > > I just tried the latest request package and it HAS the same syntax error. > > > > On Thursday, November 14, 2013 11:10:27 AM UTC-8, Reza Razavipour wrote: >> >> Just learned how to use the NODE_DEBUG env settings. Now I get a syntax >> error in >> >> ./node_modules/soap/node_modules/request/lib/debug.js >> >> module.exports = >> function debug () { >> if (/\brequest\b/.test(process.env.NODE_DEBUG)) >> console.error('REQUEST %s', util.format.apply(util, arguments)) >> } >> >> ReferenceError: util is not defined >> >> >> Any ideas what the issue might be? Does not look like this code can ever >> work if the NODE_DEBUG is set correctly. >> >> >> Thoughts? >> > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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: request package syntax error with NODE_DEBUG defined
it was NOT in the version I am running, I added it... I was getting the syntax error since it had the problem Regards, Reza On Thu, Nov 14, 2013 at 2:33 PM, Mikeal Rogers wrote: > that was committed, it's in master. are you sure it's in the version > you're running? > > On Nov 14, 2013, at 2:31PM, Reza Razavipour > wrote: > > it turns out to be a bug, that was fixed but never committed. > > > https://github.com/mikeal/request/commit/b8cf8743b66d8eee4048561a7d81659f053393c8 > > > > On Thursday, November 14, 2013 11:32:54 AM UTC-8, Reza Razavipour wrote: >> >> I just tried the latest request package and it HAS the same syntax error. >> >> >> >> On Thursday, November 14, 2013 11:10:27 AM UTC-8, Reza Razavipour wrote: >>> >>> Just learned how to use the NODE_DEBUG env settings. Now I get a syntax >>> error in >>> >>> ./node_modules/soap/node_modules/request/lib/debug.js >>> >>> module.exports = >>> function debug () { >>> if (/\brequest\b/.test(process.env.NODE_DEBUG)) >>> console.error('REQUEST %s', util.format.apply(util, arguments)) >>> } >>> >>> ReferenceError: util is not defined >>> >>> >>> Any ideas what the issue might be? Does not look like this code can ever >>> work if the NODE_DEBUG is set correctly. >>> >>> >>> Thoughts? >>> >> > -- > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to nodejs@googlegroups.com > To unsubscribe from this group, 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 a topic in the > Google Groups "nodejs" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/nodejs/7qg21-mxDTU/unsubscribe. > To unsubscribe from this group and all its topics, 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] how to create a singleton
A newbie question... I have an app that connects and reuses the same connection to a remote database and a connection to a remote soap server. I want to implement a singleton pattern for each of these. I am used to doing that in C++ and Java but want to know what the standard implementation for a Singleton pattern is in node.js. Any recommendations or 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: how to create a singleton
Wonderful book, thank you. So reading the book, if I put the code for the mySingleton class into a file on its own, call it single.js. In my main.js, I add that with a require statement, such as var singleton = require('./.single); when I say, singleton.getInstance(), I get a compile error saying singleton does not have a getInstance function... Do I have to add an export to the single.js file I created or what am I missing... The code is as follows: var mySingleton = (function() { var instance; function init() { var privateRandomNumber = Math.random(); return { publicMethod : function() { console.log("The public can see me!"); }, publicProperty : "I am also public", getRandomNumber : function() { return privateRandomNumber; }, getInstance : function() { if (!instance) { instance = init(); } return instance; } }; }; return { getInstance : function() { if (!instance) { instance = init(); } return instance; } }; })(); Thanks for the help. Reza On Monday, November 18, 2013 3:38:09 PM UTC-8, Reza Razavipour wrote: > > A newbie question... > > I have an app that connects and reuses the same connection to a remote > database and a connection to a remote soap server. > I want to implement a singleton pattern for each of these. I am used to > doing that in C++ and Java but want to know what the standard > implementation for a Singleton pattern is in node.js. > > Any recommendations or 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: how to create a singleton
Awesome that works wonderfully. Thanks. One more issue that you have an idea on, is that in getInstance I have to make an async call. It creates a soap connection and that is only supported in async mode. Any thoughts on how to structure that code? On Monday, November 18, 2013 3:38:09 PM UTC-8, Reza Razavipour wrote: > > A newbie question... > > I have an app that connects and reuses the same connection to a remote > database and a connection to a remote soap server. > I want to implement a singleton pattern for each of these. I am used to > doing that in C++ and Java but want to know what the standard > implementation for a Singleton pattern is in node.js. > > Any recommendations or 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.
Re: [nodejs] Re: how to create a singleton
I could then it would get ugly, because now whoever calls getInstance have to provide a callback. If only I could turn the async to a sync call On Monday, November 18, 2013 5:43:52 PM UTC-8, Jose wrote: > > I guess you can do it in getInstance or init but you're gonna need to pass > a callback to support the async mode > > On Nov 19, 2013, at 3:30 AM, Reza Razavipour > > > wrote: > > Awesome that works wonderfully. Thanks. > > One more issue that you have an idea on, is that in getInstance I have to > make an async call. It creates a soap connection and that is only supported > in async mode. > Any thoughts on how to structure that code? > > > > On Monday, November 18, 2013 3:38:09 PM UTC-8, Reza Razavipour wrote: >> >> A newbie question... >> >> I have an app that connects and reuses the same connection to a remote >> database and a connection to a remote soap server. >> I want to implement a singleton pattern for each of these. I am used to >> doing that in C++ and Java but want to know what the standard >> implementation for a Singleton pattern is in node.js. >> >> Any recommendations or 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 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.
Re: [nodejs] Re: how to create a singleton
this I get the jist of the conversation but my Javascript skills, less than 2 months, does not allow me to be able to code this up. Also, as a starter in the new language the last thing I want to do is to miss out on the language correct way of things and force lets say the Java way of doing things in JS. Can you show me a skeleton of such function and a tiny consumer of that? The reason I say that is the fact that all of the examples are all done in the same JS file and not setup as module and when I try to change to a module and a consumer, I run into syntax problems and I do not understand the difference between a class exporting an object as opposed to a constructor Thank you so much for showing me the correct way On Thursday, November 21, 2013 7:37:32 AM UTC-8, Kamil Leszczuk wrote: > > Aah, nevermind then, I misunerstood ;) > 21 lis 2013 16:36 "Gregg Caines" > > napisał(a): > >> Yeah... that's what I'm saying :) >> >> G >> >> >> On Thu, Nov 21, 2013 at 7:33 AM, Kamil Leszczuk >> >> > wrote: >> >>> > For example, if I have a module for emailing with a send() method on >>> it, I don't have it export a constructor; I have it export an object. That >>> object might maintain some state or it might not. When the module is >>> subsequently require()'d, it will have any state that it has accumulated >>> since. >>> >>> For.most of the time, that's unnecessary - multiple require() calls for >>> the same module return same, cached module, so you can store state just by >>> using local variables in that 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 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 a topic in the >>> Google Groups "nodejs" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/nodejs/GmUto9AN47U/unsubscribe. >>> To unsubscribe from this group and all its topics, 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 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.
Re: [nodejs] Re: how to create a singleton
Ok so this is the way i have it constructed... SoapClient is my module and I want it to be used as a singleton, i.e. if it is initialized, it just returns the connection, or SoapClient.instance... var SoapClient = function() { > var soap = require('soap'); > this.init = function (){ > var url = "http://172.31.19.39/MgmtServer.wsdl";; > var endPoint = "https://172.31.19.39:9088";; > var options = {}; > options.endpoint = endPoint; > soap.createClient(url, options, function(err, result) { > if (err) { > console.log('soap client create failed ' + err); > return; > } > console.log('init is called ready'); > SoapClient.instance = result; > SoapClient.instance.setSecurity(new soap.BasicAuthSecurity( > 'admin-priv', 'password')); > }); > }; > }; > SoapClient.getInstance = function () { > if (SoapClient.instance) { > return SoapClient.instance; > } > new SoapClient().init(); > return SoapClient.instance; > }; > SoapClient.instance = null; > module.exports = SoapClient; Thoughts On Thursday, November 21, 2013 8:34:14 AM UTC-8, Reza Razavipour wrote: > > this I get the jist of the conversation but my Javascript skills, less > than 2 months, does not allow me to be able to code this up. > Also, as a starter in the new language the last thing I want to do is to > miss out on the language correct way of things and force lets say the Java > way of doing things in JS. > > Can you show me a skeleton of such function and a tiny consumer of that? > The reason I say that is the fact that all of the examples are all done in > the same JS file and not setup as module and when I try to change to a > module and a consumer, I run into syntax problems and > > I do not understand the difference between a class exporting an object as > opposed to a constructor > > > Thank you so much for showing me the correct way > On Thursday, November 21, 2013 7:37:32 AM UTC-8, Kamil Leszczuk wrote: >> >> Aah, nevermind then, I misunerstood ;) >> 21 lis 2013 16:36 "Gregg Caines" napisał(a): >> >>> Yeah... that's what I'm saying :) >>> >>> G >>> >>> >>> On Thu, Nov 21, 2013 at 7:33 AM, Kamil Leszczuk wrote: >>> >>>> > For example, if I have a module for emailing with a send() method on >>>> it, I don't have it export a constructor; I have it export an object. >>>> That >>>> object might maintain some state or it might not. When the module is >>>> subsequently require()'d, it will have any state that it has accumulated >>>> since. >>>> >>>> For.most of the time, that's unnecessary - multiple require() calls for >>>> the same module return same, cached module, so you can store state just by >>>> using local variables in that 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 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 a topic in the >>>> Google Groups "nodejs" group. >>>> To unsubscribe from this topic, visit >>>> https://groups.google.com/d/topic/nodejs/GmUto9AN47U/unsubscribe. >>>> To unsubscribe from this group and all its topics, 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 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 >&g
[nodejs] Re: how to create a singleton
thanks for the response. I will have to 'digest' it but I get the idea you are laying out. My original intent is for the consumer of this object is to use the "client" synchronously on demand, as opposed to async. On Monday, November 18, 2013 3:38:09 PM UTC-8, Reza Razavipour wrote: > > A newbie question... > > I have an app that connects and reuses the same connection to a remote > database and a connection to a remote soap server. > I want to implement a singleton pattern for each of these. I am used to > doing that in C++ and Java but want to know what the standard > implementation for a Singleton pattern is in node.js. > > Any recommendations or 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] difference between a module and a class
I am not clear what the difference is referring to a module and a generic class/function that i create and use. Can someone care to explain -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] define is not defined errot
so I am trying to export a class constructor... This is what I have done based on my readings. define('SystemVersionResponse', function() { function SystemVersionResponse(input) { this.errorMessage = String.fromCharCode.apply(String, input.rsp.rsp.errorMessage.item).replace(/\0/g,''); this.errorNumber = input.rsp.rsp.errorMessage.errorNumber; } SystemVersionResponse.prototype.getErrorCode = function() { return errorNumber; }; SystemVersionResponse.prototype.getErrorMessage = function() { return errorMessage; }; SystemVersionResponse.prototype.getRevision = function() { return revision; }; return SystemVersionResponse; }); I get the syntax error: ReferenceError: define is not defined What package am I missing? Is this the correct way to export a constructor? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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 convert an array of 16 bytes to an IP address
I am getting an array of 16 bytes from my SOAP server and need to convert that to an IP address on the client side done in Javascript. For instance, i get 50,53,53,46,50,53,53,46,48,46,48,0,0,0,0,0 How do I convert this into a IP address string? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] custom objects and jsonification
I have a custom function (constructor). it has a number of member variables. I am using Express. What I need to do is to return a JSON, to the client, containing an array of my custom function. So lets say I have MyObject, it has member name and password. I have an array of MyObject instances. I need to send a JSON representing this array. Do I have to have a jsonify function for MyObject and call this for each object in my array? Or is there an easier, built-in function for this kind of work? Reza -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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 design a changelog processing
Let me explain. So my javascript client will need to send a changelog to my node server. The changelog will consist of commands and parameters. CRUD commands. So one example can be comprised two commands: item 1 : create staticroute param1 param2 item 2 : update network param1 param2 param3. How should the data from the client look like. I am using express and routing but I am more interested in the format of the request. Thoughts? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] logging module for node.js
I am looking for a asynchronous logging module for node/express. It needs to support daily or size based roll-over and ideally not required support for custom level. Any recommendations? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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 design a changelog processing
I have decided to turn the changelog into an array of JSONs and put it the request body of POST to my express route. Not sure for the syntax of this array of JSONs Any help? On Wednesday, December 4, 2013 8:29:30 AM UTC-8, Reza Razavipour wrote: > > Let me explain. > > So my javascript client will need to send a changelog to my node server. > The changelog will consist of commands and parameters. CRUD commands. > So one example can be comprised two commands: > > item 1 : create staticroute param1 param2 > item 2 : update network param1 param2 param3. > > How should the data from the client look like. I am using express and > routing but I am more interested in the format of the request. > > Thoughts? > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] node programming style question
I see both style and trying to understand the differences... Debugging, logging, other plus or minus... Option one: var zero = function (n){ return n < 10 ? "0" + n : n; }; Option two: function zero (n){ return n < 10 ? "0" + n : n; }; What is the "recommended" style and why? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] HTTP and soap message
I have a node/soap client sending SOAP calls to a remote SOAP server. I make SOAP call using the soap node module, on a Mac and the SOAP server receives the following: http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:urn="urn:MgmtServer"> admin-priv password the same SOAP client code, on CentOS, making the same call, the SOAP server receives: soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:tns="urn:MgmtServer/MgmtServer.wsdl" xmlns:ns="urn:MgmtServer"> <0><<1>u<2>r<3>n<4>:<5>m<6>g<7>m<8>t<9>V<10>a<11>l<12>i<13>d<14>a<15>t<16>e<17>P<18>a<19>s<20>s<21>w<22>o<23>r<24>d<25> <26>s<27>o<28>a<29>p<30>e<31>n<32>v<33>:<34>e<35>n<36>c<37>o<38>d<39>i<40>n<41>g<42>S<43>t<44>y<45>l<46>e<47>=<48>'<49>h<50>t<51>t<52>p<53>:<54>/<55>/<56>s<57>c<58>h<59>e<60>m<61>a<62>s<63>.<64>x<65>m<66>l<67>s<68>o<69>a<70>p<71>.<72>o<73>r<74>g<75>/<76>s<77>o<78>a<79>p<80>/<81>e<82>n<83>c<84>o<85>d<86>i<87>n<88>g<89>/<90>'<91>><92> <93> <94><<95>u<96>s<97>e<98>r<99> <100> <101><102> <103>x<104>s<105>i<106>:<107>t<108>y<109>p<110>e<111>=<112>'<113>x<114>s<115>d<116>:<117>s<118>t<119>r<120>i<121>n<122>g<123>'<124> <125> <126> <127> <128>x<129>s<130>:<131>t<132>y<133>p<134>e<135>=<136>'<137>t<138>y<139>p<140>e<141>:<142>s<143>t<144>r<145>i<146>n<147>g<148>'<149> <150> <151> <152> <153>x<154>m<155>l<156>n<157>s<158>:<159>x<160>s<161>=<162>'<163>h<164>t<165>t<166>p<167>:<168>/<169>/<170>w<171>w<172>w<173>.<174>w<175>3<176>.<177>o<178>r<179>g<180>/<181>2<182>0<183>0<184>0<185>/<186>X<187>M<188>L<189>S<190>c<191>h<192>e<193>m<194>a<195>-<196>i<197>n<198>s<199>t<200>a<201>n<202>c<203>e<204>'<205>><206>a<207>d<208>m<209>i<210>n<211>-<212>p<213>r<214>i<215>v<216><<217>/<218>u<219>s<220>e<221>r<222>><223> <224><<225>p<226>a<227>s<228>s<229>w<230>o<231>r<232>d<233> <234> <235> <236> <237>x<238>s<239>i<240>:<241>t<242>y<243>p<244>e<245>=<246>'<247>x<248>s<249>d<250>:<251>s<252>t<253>r<254>i<255>n<256>g<257>'<258> <259> <260> <261> <262> <263>x<264>s<265>:<266>t<267>y<268>p<269>e<270>=<271>'<272>t<273>y<274>p<275>e<276>:<277>s<278>t<279>r<280>i<281>n<282>g<283>'<284> <285> <286> <287> <288>x<289>m<290>l<291>n<292>s<293>:<294>x<295>s<296>=<297>'<298>h<299>t<300>t<301>p<302>:<303>/<304>/<305>w<306>w<307>w<308>.<309>w<310>3<311>.<312>o<313>r<314>g<315>/<316>2<317>0<318>0<319>0<320>/<321>X<322>M<323>L<324>S<325>c<326>h<327>e<328>m<329>a<330>-<331>i<332>n<333>s<334>t<335>a<336>n<337>c<338>e<339>'<340>><341>p<342>a<343>s<344>s<345>w<346>o<347>r<348>d<349><<350>/<351>p<352>a<353>s<354>s<355>w<356>o<357>r<358>d<359>><360> <361><<362>/<363>u<364>r<365>n<366>:<367>m<368>g<369>m<370>t<371>V<372>a<373>l<374>i<375>d<376>a<377>t<378>e<379>P<380>a<381>s<382>s<383>w<384>o<385>r<386>d<387>> What am I doing incorrectly? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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 implement a rollback functionality for a set of asynchrous calls
So I have a node server making calls to a SOAP server. All are asynchronous as one would expect. The node server will get a list of commands to run, each will translate to one async call. The rule is start running the commands until the list is complete or one leads to an error, i.e. a command that fails. In the case of the failure, need to rollback all the succeeded commands, really identical to a SQL transaction. The commands will have to be rolled back, in the reverse order, to ensure system integrity. Up to now, I did not have the rollback feature. So far I was using async.series with a callback for each of my commands. My commands are very analogous to SQL commands, to help picture what I need to do. Any simple ways to implement the rollback? 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] how to synchronize two async.waterfall calls
I have a set of read commands that I have to in sequence. Any fails, processing stops. readCommands is an array of read functions... async.waterfall(readCommands, function(err) { if (err) { console.log(err); res.send(500, { error : err.toString() }); return; } else { console.log('we determined the state to which we have to rollback to'); } }); at this point, I know what I started with. Now I want to do the write commands async.waterfall(writeCommands, function(err) { if (err) { console.log(err); res.send(500, { error : err.toString() }); return; } else { console.log('we succeeded with all the write commands...'); } }); the arrays readCommands and writeCommands entries are radically different so very hard to combine them. But I DO for the first waterfall to finish before I go to the next one. How do I make a "waterfall" out of the existing two? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] logging with rconsole question
I am prototyping logging for my node.js application and started with rconsole package. Not clear how to set the logging levels. I have the following code and regardless of what debug level I set, I see the same output. require('rconsole') console.set({ facility: 'local0' // default: user , title: 'web-01' // default: node -- can also be set with `process.title` , highestLevel: 'err' // [emerg, alert, crit, err, warning, notice, info, debug] , stdout: false // default: false , stderr: true // default: true , syslog: true // default: true , syslogHashTags: false // default: false , showTime: true// default: true , showLine: true// default: true , showFile: true// default: true , showTags: true// default: true }) console.warn('level is set to err and this is a warn'); console.notice('notice'); console.error('error'); console.set({ highestLevel: 'notice', stderr: false }) console.warn('level is set to notice warn and this is a warn'); console.notice('notice'); console.error('error'); console.set({ highestLevel: 'crit', stderr: false }) console.warn('level is set to notice crit and this is a warn'); console.notice('notice'); console.error('error'); and the output, I always see the same output which is level is set to err and this is a warn notice error level is set to notice warn and this is a warn notice error level is set to notice crit and this is a warn notice error Can someone explain to me what I am doing wrong here? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] logging with rconsole question
same output, no change after using error. This is on a Mac, I do not thin that changes anything though. On Friday, December 27, 2013 8:57:46 AM UTC-8, Thomas wrote: > > I don't think `err` is a valid string, try `error` instead > > Thomas Blobaum > https://github.com/tblobaum/ > > > On Fri, Dec 27, 2013 at 10:20 AM, Reza Razavipour > > > wrote: > >> I am prototyping logging for my node.js application and started with >> rconsole package. Not clear how to set the logging levels. I have the >> following code and regardless of what debug level I set, I see the same >> output. >> >> require('rconsole') >> >> >> console.set({ >> facility: 'local0' // default: user >> , title: 'web-01' // default: node -- can also be set with >> `process.title` >> , highestLevel: 'err' // [emerg, alert, crit, err, warning, notice, >> info, debug] >> , stdout: false // default: false >> , stderr: true // default: true >> , syslog: true // default: true >> , syslogHashTags: false // default: false >> , showTime: true// default: true >> , showLine: true// default: true >> , showFile: true// default: true >> , showTags: true// default: true }) >> >> >> console.warn('level is set to err and this is a warn'); >> console.notice('notice'); >> console.error('error'); >> >> console.set({ >> highestLevel: 'notice', >> stderr: false >> }) >> >> console.warn('level is set to notice warn and this is a warn'); >> console.notice('notice'); >> console.error('error'); >> console.set({ >> highestLevel: 'crit', >> stderr: false >> }) >> >> console.warn('level is set to notice crit and this is a warn'); >> console.notice('notice'); >> console.error('error'); >> >> and the output, I always see the same output which is >> >> level is set to err and this is a warn >> notice >> error >> level is set to notice warn and this is a warn >> notice >> error >> level is set to notice crit and this is a warn >> notice >> error >> >> Can someone explain to me what I am doing wrong here? >> >> -- >> -- >> Job Board: http://jobs.nodejs.org/ >> Posting guidelines: >> https://github.com/joyent/node/wiki/Mailing-List-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.
[nodejs] node server and keeping remote connections alive
I have a node server that needs to communicate with a single remote SOAP server. I establish this connection and reuse it throughout the run. Except this server is not very reliable and crashes some time :( So at some point during the run, I make a call and I get socket connection error. What is a standard customary, pattern, to deal with this issue. To ensure the integrity of a remote connection? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] npm not running on CentOS
I am trying to install node on ` CentOS 2.6.31.11-an_centos6-v42 #3 SMP Thu Oct 31 12:17:24 PDT 2013 i686 i686 i386 GNU/Linux I download the tar file from nodejs.org. tar -xf node-v0.10.23.tar.gz cd node-v0.10.23 ./configure make I see node in node-v0.10.23/node pointing to out/Release/node. So node runs and all is well. npm is not working though. Not sure why. I only see npm below node-v0.10.23, only in ./deps/npm ./deps/npm/bin/npm ./tools/msvs/npm ./doc/blog/npm so npm is not working so no npm install. Am I missing a step? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] npm not running on CentOS
I see that, thank you Regards, Reza On Mon, Dec 30, 2013 at 2:38 PM, T.C. Hollingsworth < tchollingswo...@gmail.com> wrote: > On Dec 30, 2013 3:05 PM, "Reza Razavipour" > wrote: > > > > I am trying to install node on ` > > > > CentOS 2.6.31.11-an_centos6-v42 #3 SMP Thu Oct 31 12:17:24 PDT 2013 > i686 i686 i386 GNU/Linux > > > > I download the tar file from nodejs.org. > > > > tar -xf node-v0.10.23.tar.gz > > cd node-v0.10.23 > > ./configure > > make > > > > I see node in node-v0.10.23/node pointing to out/Release/node. So node > runs and all is well. npm is not working though. Not sure why. > > > > I only see npm below node-v0.10.23, only in > > > > ./deps/npm > > ./deps/npm/bin/npm > > ./tools/msvs/npm > > ./doc/blog/npm > > > > so npm is not working so no npm install. Am I missing a step? > > You forgot 'sudo make install'. Then both node and npm will be in your > $PATH. > > If you try to execute npm directly without that, it won't be able to find > node. If you really don't want to install it, you'll have to run it like > './out/Release/node deps/npm/cli.js' or fix its shebang line for it to work. > > Note that on CentOS you can just enable EPEL and 'sudo yum install npm' > also. :-) > > -T.C. > > -- > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to nodejs@googlegroups.com > To unsubscribe from this group, 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 a topic in the > Google Groups "nodejs" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/nodejs/rcT2BOgzNR4/unsubscribe. > To unsubscribe from this group and all its topics, 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] npm not running on CentOS
I see that now. Thank you Reza On Monday, December 30, 2013 2:38:58 PM UTC-8, T.C. Hollingsworth wrote: > > On Dec 30, 2013 3:05 PM, "Reza Razavipour" > > > wrote: > > > > I am trying to install node on ` > > > > CentOS 2.6.31.11-an_centos6-v42 #3 SMP Thu Oct 31 12:17:24 PDT 2013 > i686 i686 i386 GNU/Linux > > > > I download the tar file from nodejs.org. > > > > tar -xf node-v0.10.23.tar.gz > > cd node-v0.10.23 > > ./configure > > make > > > > I see node in node-v0.10.23/node pointing to out/Release/node. So node > runs and all is well. npm is not working though. Not sure why. > > > > I only see npm below node-v0.10.23, only in > > > > ./deps/npm > > ./deps/npm/bin/npm > > ./tools/msvs/npm > > ./doc/blog/npm > > > > so npm is not working so no npm install. Am I missing a step? > > You forgot 'sudo make install'. Then both node and npm will be in your > $PATH. > > If you try to execute npm directly without that, it won't be able to find > node. If you really don't want to install it, you'll have to run it like > './out/Release/node deps/npm/cli.js' or fix its shebang line for it to work. > > Note that on CentOS you can just enable EPEL and 'sudo yum install npm' > also. :-) > > -T.C. > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] SSL and express
I am supporting a node application using express, https module. How can I determine which version of SSL i am using and what the settings are? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] Strange bug in benchmark, Express.js is slower than Ruby on Rails
what was the fix? You changed the 5 to what? On Thursday, January 23, 2014 7:19:06 AM UTC-8, Alexey Petrushin wrote: > > Fedor, you are right, thanks. That was the problem, after fixing it node > became more than 10 times faster. > > Issue resolved. > > On Thursday, 23 January 2014 14:15:19 UTC+4, Fedor Indutny wrote: >> >> I think you could be hitting this: >> http://nodejs.org/api/http.html#http_agent_maxsockets >> >> On Thu, Jan 23, 2014 at 1:57 PM, Alexey Petrushin >> wrote: >> > I ran a benchmark for Ruby on Rails and Express.js using `siege` - and >> > Express for some reason performed worse than Rails. >> > >> > How benchmark works - application query some text from remote HTTP >> service >> > (service delays each >> > request for 200ms) and render HTML page using that text. >> > >> > Results >> > >> > - transactions rate are the same (already strange, I expected node.js >> to >> > outperform rails by at least a couple of times) >> > - average response time in rails is 0.8s and in express 4s (siege >> doesn't >> > show average time it in the report, but it can be seen from its logs). >> > >> > Details >> > >> > The remote service with delay (sipmle node.js server) >> > >> https://github.com/alexeypetrushin/web-frameworks-benchmarks/blob/master/lorem-ipsum.js >> >> > >> > Express.js >> > >> https://github.com/alexeypetrushin/web-frameworks-benchmarks/blob/master/expressjs/app.js >> >> > >> > Rails (with Puma server) >> > >> https://github.com/alexeypetrushin/web-frameworks-benchmarks/blob/master/rails/app/controllers/posts_controller.rb >> >> > >> > Siege command `siege -b -t10s -c100 http://localhost:3000` >> > >> > Full code and instructions how to run >> > https://github.com/alexeypetrushin/web-frameworks-benchmarks >> > All application has been run in production mode. >> > >> > How is that possible and where is the bug in this benchmark, what's I'm >> > doing 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 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.
[nodejs] callback hell on steroid
I have a node.js, express really, app that needs to make SOAP calls, asynchronously of course. In this case, I make a soap call and I get a count. Once i have the count, I have to loop and make a series of SOAP calls for each, this part you can think of this as async.series calls. I have used async waterfall, series, parallel and Q promises; somewhat comfortable with them. How do you suggest I set this up to avoid callback hell and have control over exceptions and the rest. I can not see how this should be laid 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] chaining a promise and array of promises
I am using Q for my promise library. I have a promise that if success calls and array of promises. The code is: getCount(client).then(function (count) { // when successful create a var promises = []; // array of promises to be processed next for (var i = 0; i < count; i++) { // in order promises.push(az(client, i)); } return Q.all(promises); }).then(function(results) { console.log("everything went right. All results:", results); }, function(err) { console.log("something (either getCount, or one of the az calls) blew up", err); }); so az takes and index and returns a value. If index === 1 it throws. function az(client, index) { var xml = " "; client.MgmtServer.MgmtServer.asynCall(xml, function (err, result) { if (err) { return deferred.reject(err); } if (1 === index) { console.log('index 1 is bad news'); return deferred.reject("Blew up"); } console.log('returning with index ' + index + ' returning ' + (index + 30)); deferred.resolve(index + 30); } ); return deferred.promise; }; when I run this, I see this output: everything went right. All results: [ 3, 3, 3 ] returning with index 0 returning 30 index 1 is bad news returning with index 2 returning 32 Output of getCount first then az 1 2 3 and the exception for 1 never sending me to console.log("something (either getCount, or one of the az calls) blew up", err); Am I using my array of promises incorrectly? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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 perform an action at a set frequency?
I have a node application and I need to ensure a database connection stays open and operational. I want to do lets say every 30 seconds. What is the customary approach in node? 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: how to perform an action at a set frequency?
this a soap server connection and I do not see a way to do what you are recommending? Am i missing it? On Wednesday, February 19, 2014 8:45:15 AM UTC-8, Reza Razavipour wrote: > > I have a node application and I need to ensure a database connection stays > open and operational. I want to do lets say every 30 seconds. > What is the customary approach in node? > > 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: how to perform an action at a set frequency?
i use soap... npm install soap and then for postgres database I use pg package. Regards, Reza On Mon, Feb 24, 2014 at 2:17 PM, Raymond Feng wrote: > Do you access a database via the SOAP/WS API? If so, what SOAP Node.js > library do you use? > > Thanks, > Raymond > > On Wednesday, February 19, 2014 9:14:35 AM UTC-8, Reza Razavipour wrote: >> >> this a soap server connection and I do not see a way to do what you are >> recommending? Am i missing it? >> >> >> On Wednesday, February 19, 2014 8:45:15 AM UTC-8, Reza Razavipour wrote: >>> >>> I have a node application and I need to ensure a database connection >>> stays open and operational. I want to do lets say every 30 seconds. >>> What is the customary approach in node? >>> >>> 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 a topic in the > Google Groups "nodejs" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/nodejs/vWM1wlEXYy8/unsubscribe. > To unsubscribe from this group and all its topics, 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] node and database connection pool
If node is single threaded and I can only be making one database call at any time, what is the point of having a pool of db connnections? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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] node and database connection pool
makes perfect sense, thank you Regards, Reza On Wed, Feb 26, 2014 at 9:16 AM, Angel Java Lopez wrote: > JavaScript in Node is single thread. But async I/O is derived to LibUv, > that uses threads. Usually, a DB driver calls the database server, using > sockets. Then, that communication will be handle by LibUv, returning the > results in a callback. Your single JS threads is available for other tasks > > Angel "Java" Lopez > @ajlopez > > > > On Wed, Feb 26, 2014 at 2:14 PM, Reza Razavipour < > reza.razavip...@gmail.com> wrote: > >> If node is single threaded and I can only be making one database call at >> any time, what is the point of having a pool of db connnections? >> >> -- >> -- >> Job Board: http://jobs.nodejs.org/ >> Posting guidelines: >> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines >> You received this message because you are subscribed to the Google >> Groups "nodejs" group. >> To post to this group, send email to nodejs@googlegroups.com >> To unsubscribe from this group, 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 a topic in the > Google Groups "nodejs" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/nodejs/-_pSIeB7Vws/unsubscribe. > To unsubscribe from this group and all its topics, 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] node and database connection pool
Matt, just so I understand, you are saying if a node package such as mongodb provides connection pooling, they have to be implementing the package using a pooling system that is implemented in C? On Wednesday, February 26, 2014 11:50:18 AM UTC-8, ajlopez wrote: > > Some more concrete example, to support my assertion, and to have a clear > picture of what can be used. > > I just found: > > https://github.com/felixge/node-mysql > > It manage a pool: > https://github.com/felixge/node-mysql/blob/master/lib/Pool.js > A pool manage a list of available Connection > https://github.com/felixge/node-mysql/blob/master/lib/Connection.js > and connection use require('net') > > That's the magic! ;-) The driver author uses LibUv indirectly. > > Angel "Java" Lopez > @ajlopez > > > > On Wed, Feb 26, 2014 at 4:45 PM, Angel Java Lopez > > > wrote: > >> Ummm... You can write a driver in JS code that use require('net'). And in >> that module, the socket I/O is, at the end, managed by LibUv. The same for >> require('fs') for file I/O. >> >> Am I right? >> >> And yes, the driver could be implemented in C, and then, it should call >> LibUv in some way. >> >> Angel "Java" Lopez >> @ajlopez >> >> >> >> On Wed, Feb 26, 2014 at 4:26 PM, Matt >wrote: >> >>> But unfortunately isn't how it works at all, unless the database driver >>> in question is using C libraries which use the thread pool (which most of >>> them don't these days). >>> >>> It's all about the event loop. Here's how an event loop works: >>> http://baudehlo.com/2013/02/14/how-an-event-loop-works/ >>> >>> >>> On Wed, Feb 26, 2014 at 12:53 PM, Reza Razavipour >>> >>> > wrote: >>> >>>> makes perfect sense, thank you >>>> >>>> Regards, >>>> Reza >>>> >>>> >>>> On Wed, Feb 26, 2014 at 9:16 AM, Angel Java Lopez >>>> >>>> > wrote: >>>> >>>>> JavaScript in Node is single thread. But async I/O is derived to >>>>> LibUv, that uses threads. Usually, a DB driver calls the database server, >>>>> using sockets. Then, that communication will be handle by LibUv, >>>>> returning >>>>> the results in a callback. Your single JS threads is available for other >>>>> tasks >>>>> >>>>> Angel "Java" Lopez >>>>> @ajlopez >>>>> >>>>> >>>>> >>>>> On Wed, Feb 26, 2014 at 2:14 PM, Reza Razavipour >>>>> >>>>> > wrote: >>>>> >>>>>> If node is single threaded and I can only be making one database call >>>>>> at any time, what is the point of having a pool of db connnections? >>>>>> >>>>>> -- >>>>>> -- >>>>>> Job Board: http://jobs.nodejs.org/ >>>>>> Posting guidelines: >>>>>> https://github.com/joyent/node/wiki/Mailing-List-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 nod...@googlegrou
[nodejs] Node.js and cross-domain AJAX requests
I work on a express.js connect and node server. The client is done using AngularJS and it will to make calls to number of different backend node servers. Based on my reading and understanding of cross-domain requests, the calls to the servers from which the client did not originate will fail. Is that the expected behavior? If so, what the most common solution to this problem? Does it involve changes to the node server? Reza -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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/d/optout.
Re: [nodejs] Node.js and cross-domain AJAX requests
use JSONP on server, client or both? I accept I am not aware of JSONP Regards, Reza On Wed, Mar 12, 2014 at 12:59 PM, Matt wrote: > > On Wed, Mar 12, 2014 at 2:22 PM, Reza Razavipour < > reza.razavip...@gmail.com> wrote: > >> The client is done using AngularJS and it will to make calls to number of >> different backend node servers. >> Based on my reading and understanding of cross-domain requests, the calls >> to the servers from which the client did not originate will fail. >> Is that the expected behavior? >> > > Yes. > > >> If so, what the most common solution to this problem? >> > > Use JSONP. > > >> Does it involve changes to the node server? >> > > A small change yes: app.set("jsonp callback", true); > > -- > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to nodejs@googlegroups.com > To unsubscribe from this group, 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 a topic in the > Google Groups "nodejs" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/nodejs/CgC9ILwBUFs/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > nodejs+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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/d/optout.
[nodejs] exports and new function
I am looking at a node code snippet and I see: module.exports = new MyClass(); What does that mean and how is it used? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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/d/optout.
[nodejs] how to read file from a relative path
So i have a node app and I have the following: var options = { key: fs.readFileSync('./server.key'), cert: fs.readFileSync('./server.crt') }; This only works if I run the app from these 2 files are. How do I change my code so that it works regardless of where it is launched from? I am looking for the "node" way of doing this. I know I can use an env variable to get around this. Thoughts? Reza -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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/d/optout.
[nodejs] nosql database driver
is there one for dovetaildb? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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/d/optout.
[nodejs] Re: Im looking a Partner to finish a development in node.js and socket.io/websocket
say more On Friday, April 4, 2014 6:43:14 AM UTC-7, Cristian Betteley wrote: > > Im looking a developer that finish a job using node.js and socket.io, is > 90% done, and is very simple, we are willing to share % of the business if > you have the knoweledge. > > The business will be post this next month to a Goverment Capital Funds > here in Chile, and we have good oportunity (2 finals and 1 winning) to > raise 100.000USD to initiate the company, been notified this April, if you > are looking to come here to chile in Statup enviroment, please contact us. > 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/d/optout.
[nodejs] memory model in node.js
So one allocates memory, new and many of these and when does the cleanup take place? When you start a node process, you can specify a maximum amount of memory for the life of the process. Does the whole thing get allocated at start up? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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/d/optout.
Re: [nodejs] memory model in node.js
thanks for the response. Any useful reference to learn about V8's heap ? On Thursday, April 10, 2014 8:41:23 AM UTC-7, Aria Stewart wrote: > > On Apr 10, 02014, at 11:39, Reza Razavipour > > > wrote: > > > So one allocates memory, new and many of these and when does the cleanup > take place? > > Lazily; it’s a generational garbage collector, so some small and new > things get collected quickly; old things tend to get cleaned up a bit less > often. > > > When you start a node process, you can specify a maximum amount of > memory for the life of the process. Does the whole thing get allocated at > start up? > > No. And that’s just a limit for V8’s heap, and doesn’t count toward some > of Node’s structures. > > Aria > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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/d/optout.
[nodejs] node.js and IPC
Any recommendations for message queues in node? Socket based communication is done socket.io, is that correct? Any good modules that wrap it? 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/d/optout.
[nodejs] Re: node.js and IPC
By wrap, I really meant a module with some syntactical sugar On Thursday, April 10, 2014 9:22:03 AM UTC-7, Reza Razavipour wrote: > > Any recommendations for message queues in node? > Socket based communication is done socket.io, is that correct? Any good > modules that wrap it? > > 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/d/optout.
Re: [nodejs] node.js and IPC
Also the message queue packages you mentioned are based on POSIX message queues, I take it. On Thursday, April 10, 2014 10:53:12 AM UTC-7, Aria Stewart wrote: > > On Apr 10, 02014, at 12:22, Reza Razavipour > > > wrote: > > > Any recommendations for message queues in node? > > I love me some Gearman, other people love zeromq and AMQP adapters. > > > Socket based communication is done socket.io, is that correct? Any good > modules that wrap it? > > socket.io is specifically a wrapper around websockets and roughly > equivalent transports: It’s for talking to browsers. Don’t confuse that > with classic network sockets — you’ll be sad. > > If that’s what you need, awesome — also consider raw websockets if your > networks will pass it and browsers support it; DNode; xmpp-bosh; SockJS, > Primus (a wrapping adapter for many of these), engine.io … lots of > options on the websocket-like functions. > > If you want plain network sockets, look at the built-in ‘net’ module — it > supports TCP and UDP sockets. > > What do you mean by “wrap”? What function are you expecting to get out of > such a module? > > Aria > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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/d/optout.
Re: [nodejs] node.js and IPC
I found this https://github.com/mscdex/pmq Looks promising. On Thursday, April 10, 2014 11:11:07 AM UTC-7, Aria Stewart wrote: > > > On Apr 10, 02014, at 13:59, Reza Razavipour > > > wrote: > > > Also the message queue packages you mentioned are based on POSIX message > queues, I take it. > > Nope — network protocols and services. Node doesn’t expose much that is > exclusively unixy, so you’re looking at binary addons to do things like > that. > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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/d/optout.
[nodejs] read a file one line at a time
I need to read a file one line at a time. Similar to getLine in C++ and Java. How does one do that in node.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 --- 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/d/optout.
[nodejs] can one use socket.io for domain sockets?
I was planning on using socket.io to connect to my node.js client to a server using POSIX sockets. The server is being redesigned to support domain sockets since both server and my node client will always run on the same host. Can I still use socket.io module or do I have to look for some other module? If not, any module recommendation? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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/d/optout.
[nodejs] Re: can one use socket.io for domain sockets?
I had started looking at that, thank you. So here is what I need to do to communicate to the server. The server has created a UNIX domain socket, lets call it /tmp/connect_to_me and it is listening on it for connections. Lets switch to C++ for a second since the server is in C++ So client attempts to connect to /tmp/connect_to_me, the server accepts that and returns a "file descriptor" to the client for reading and writing... That is what my node client has to do. So now having read the net module, I can net.connect to /tmp/connect_to_me but now I can read and write from the domain socket which is not what I need to do, I need to read and write from the "file descriptor" or stream returned to me by the server. And that is what I am trying to solve. Any thoughts? On Monday, April 14, 2014 3:55:49 PM UTC-7, mscdex wrote: > > On Monday, April 14, 2014 5:07:42 PM UTC-4, Reza Razavipour wrote: >> >> I was planning on using socket.io to connect to my node.js client to a >> server using POSIX sockets. >> >> The server is being redesigned to support domain sockets since both >> server and my node client will always run on the same host. >> >> Can I still use socket.io module or do I have to look for some other >> module? >> >> If not, any module recommendation? >> > > socket.io is generally for browser<-->server communication. I think your > situation would be better off with a plain 'net' socket and supplying a > path to the unix socket instead of an IP and port: > http://nodejs.org/api/net.html#net_net_connect_path_connectlistener > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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/d/optout.
[nodejs] how to write to a UNIX domain socket
so my server provide a UNIX domain socket and accepts my connection, from node.js client. My code is:var client = net.createConnection("/tmp/SocketServer"); I see that the server accepted my connection looking at the logs. next step is for me to write to this socket, or the client variable. In the debugger, client variable is of type Socket. I only see EventEmitters for the client. How do I write to 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 --- 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/d/optout.
[nodejs] Re: how to write to a UNIX domain socket
I dont know how many times I read that site and never saw the write... Thanks a lot On Tuesday, April 15, 2014 11:13:54 AM UTC-7, Reza Razavipour wrote: > > so my server provide a UNIX domain socket and accepts my connection, from > node.js client. > > My code is:var client = net.createConnection("/tmp/SocketServer"); I see > that the server accepted my connection looking at the logs. > > next step is for me to write to this socket, or the client variable. > > In the debugger, client variable is of type Socket. > > I only see EventEmitters for the client. How do I write to 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 --- 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/d/optout.
[nodejs] when to use self instead of this
I see a lot of code that does var self = this and then they use self instead of this for the duration of the function? Why and when would you use the above pattern? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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/d/optout.
Re: [nodejs] when to use self instead of this
would you still do that if you want to change something about this? mix self and this? Regards, Reza On Mon, Apr 21, 2014 at 1:13 PM, Matt wrote: > It's good practice because in callbacks "this" is no longer what you > thought it was, whereas that self variable will be. I tend to do it out of > habit even if there are no callbacks because there might be one some day > down the line. > > > On Mon, Apr 21, 2014 at 4:11 PM, Reza Razavipour < > reza.razavip...@gmail.com> wrote: > >> I see a lot of code that does >> var self = this >> >> and then they use self instead of this for the duration of the function? >> >> Why and when would you use the above pattern? >> >> >> -- >> -- >> Job Board: http://jobs.nodejs.org/ >> Posting guidelines: >> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines >> You received this message because you are subscribed to the Google >> Groups "nodejs" group. >> To post to this group, send email to nodejs@googlegroups.com >> To unsubscribe from this group, 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/d/optout. >> > > -- > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to nodejs@googlegroups.com > To unsubscribe from this group, 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 a topic in the > Google Groups "nodejs" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/nodejs/3YvqPyTIt-0/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > nodejs+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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/d/optout.
[nodejs] memory leak prevention and detection
I have no tool to help me detect memory leaks in my node server. I use WebStorm for my development. In other languages, like C++, I know what causes a leak and how to guard against them. I do not know what leaks memory. How do I got about putting such a list together for my programming discipline? What tools do you recommend for detection? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, 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/d/optout.
Re: [nodejs] memory leak prevention and detection
WHAO! if this is not a complete answer, I do not know what is. Thank you so much. I am going to study your reference materials. Much appreciated. Regards, Reza On Wed, Apr 30, 2014 at 3:11 PM, Timothy J Fontaine wrote: > Finding memory leaks in a moderately complicated program written in a > statically typed language is hard, change to a dynamic language, > JIT'ed code, garbage collection, and closures -- and well, damn, it's > hard. > > You're simply not going to be able to use a static analyzer pass on > JavaScript to identify all "memory leak". > > Keep in mind that what you're generally chasing down in JavaScript is > not actually a "memory leak", but rather a resource leak. In other > words, you're holding onto an object for longer than what you had > anticipated. A lot of times because of a function closure is holding > the resources in its parents scope, and you forgot about that part. > > Ugh. > > You picked this language because it had functions as first class and > supported closures, and now it's getting in your way! > > The best thing you can do to combat resource leaks is to write cleaner > code. Start by avoiding closures, and maybe use a control flow library > that makes that part easier for you. If you can think more in a stack > based way, that is passing your state to the functions, you know > exactly how much state you're carrying with you. And hopefully you > will stop carrying all that extra state around. > > As an aside I think Node's best control flow library, is our flow > control abstraction -- Streams. > > That being said, let's say you have an application in production today > and you want to track down a resource leak, you want to find out what > it is exactly you're keeping around. I've had to do this a lot [1]. So > have a lot of my colleagues at Joyent, and they have written a bunch > of tooling around it to make it easier [2] [3]. It's all open source > [4]. And the tooling works with artifacts that are generated on Linux > as well [5]. > > It's all done with postmortem analysis, that is using a core file > after the fact, which is ideal because if you knew you were going to > have a problem before going into production you probably just wouldn't > have gone into production before fixing the problem. The benefit here > is that if node runs out of memory it will generate a core file, and > you can debug that in place and figure out what went wrong. > > There are other solutions that people use, things like the module > heapdump [6] for example, this requires though that you knew in > advance you were having a memory problem, and could add another > module, and that you invoked a heapdump in time before the process > died. Once that's done you can load that file into chrome's inspector > tools to browse the heap. That can be painful if the file is > particularly large. > > Hopefully some of this information helps, let me know if there's > anything else you need. > > [1] http://www.joyent.com/blog/walmart-node-js-memory-leak > [2] http://www.joyent.com/developers/node/debug > [3] http://www.joyent.com/developers/node/debug/mdb > [4] https://github.com/joyent/illumos-joyent > [5] http://www.joyent.com/blog/mdb-and-linux > [6] http://npmjs.org/package/heapdump > > On Wed, Apr 30, 2014 at 8:58 AM, Reza Razavipour > wrote: > > I have no tool to help me detect memory leaks in my node server. I use > > WebStorm for my development. > > In other languages, like C++, I know what causes a leak and how to guard > > against them. > > I do not know what leaks memory. How do I got about putting such a list > > together for my programming discipline? > > What tools do you recommend for detection? > > > > -- > > -- > > Job Board: http://jobs.nodejs.org/ > > Posting guidelines: > > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > > You received this message because you are subscribed to the Google > > Groups "nodejs" group. > > To post to this group, send email to nodejs@googlegroups.com > > To unsubscribe from this group, 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/d/optout. > > -- > -
[nodejs] jasmine test cases for a SOAP server
I am writing a web server in node and express and most of the routes make SOAP calls. I want to write test cases for my routes. I have enough for my non SOAP call features. So I need to have a mock SOAP server? How would that look? What are the suggestions for this problem? -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- 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. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/0eb98594-0108-43a3-8bff-0de9efca17e3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[nodejs] Re: jasmine test cases for a SOAP server
Right now my soap calls are so deeply nested into my REST routes, I think I have to start pulling those out, and make them more accessible directly. Only then I can mock the specific calls. I was really hoping for a SOAP mock server that I can add the call supports to them but like you said I can simulate that will timeouts and something that returns some fake data. It is not trivial and it is tedious... On Wednesday, May 7, 2014 9:43:19 AM UTC-7, Paul Ciorogar wrote: > > I would make a mock object that pretends to have the functions and > callbacks of the SOAP server so that I can control what data I can get from > it. > And if you have to wait for multiple asynchronous calls to finish so that > you can reach a conclusion or build a page I would simulate that with a > setTimeout on each callback. > What did you have in mind? > > On Wednesday, May 7, 2014 4:11:03 AM UTC+4, Reza Razavipour wrote: >> >> I am writing a web server in node and express and most of the routes make >> SOAP calls. >> I want to write test cases for my routes. I have enough for my non SOAP >> call features. >> >> So I need to have a mock SOAP server? How would that look? >> >> What are the suggestions for this problem? >> > -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- 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. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/6ba9eb2b-c2e1-4d64-82ce-5ef1064c95d9%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[nodejs] Re: jasmine test cases for a SOAP server
Raymond, I am using node-soap package for my calls to the real SOAP server. How can I use this package to mock a server, I do not understand. On Wednesday, May 7, 2014 10:50:43 AM UTC-7, Raymond Feng wrote: > > https://github.com/vpulim/node-soap has the server support to mock a > service in node. > > On Wednesday, May 7, 2014 10:08:22 AM UTC-7, Reza Razavipour wrote: >> >> Right now my soap calls are so deeply nested into my REST routes, I think >> I have to start pulling those out, and make them more accessible directly. >> Only then I can mock the specific calls. >> I was really hoping for a SOAP mock server that I can add the call >> supports to them but like you said I can simulate that will timeouts and >> something that returns some fake data. >> >> It is not trivial and it is tedious... >> >> >> >> On Wednesday, May 7, 2014 9:43:19 AM UTC-7, Paul Ciorogar wrote: >>> >>> I would make a mock object that pretends to have the functions and >>> callbacks of the SOAP server so that I can control what data I can get from >>> it. >>> And if you have to wait for multiple asynchronous calls to finish so >>> that you can reach a conclusion or build a page I would simulate that with >>> a setTimeout on each callback. >>> What did you have in mind? >>> >>> On Wednesday, May 7, 2014 4:11:03 AM UTC+4, Reza Razavipour wrote: >>>> >>>> I am writing a web server in node and express and most of the routes >>>> make SOAP calls. >>>> I want to write test cases for my routes. I have enough for my non SOAP >>>> call features. >>>> >>>> So I need to have a mock SOAP server? How would that look? >>>> >>>> What are the suggestions for this problem? >>>> >>> -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- 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. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/47b9905f-18cc-4e1d-82c6-7f87fb89cb23%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[nodejs] unit testing using JSTestDriver
I am trying to learn and start using automated testing and eventually TDD. So I have some classes, plain old js code with no require. All the tests run and pass. As you as I start testing a js file that has a require in it, tests fail with ReferenceError: Can't find variable: require How do I overcome this? These tests run in the browser. -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- 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. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/049b3eb5-566f-447c-8a22-321b4ace14c3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[nodejs] Re: unit testing using JSTestDriver
Thank you Peter, that is exactly where I have landed. I feel more confident that I have made the correct choice. Reza On Thursday, May 8, 2014 9:42:21 PM UTC-7, Peter Rust wrote: > > Reza, > > Sorry, I just now noticed "JSTestDriver" in the subject. JSTestDriver is > intended for browser javascript, not node javascript -- so your code either > needs to not have any requires in it, or if it's built for node you need to > "browserify" it before testing it, or if it's built for a browser-side > require like RequireJS, you'll need to include that library with your tests > (how exactly to do that with JSTestDriver is a question for their mailing > list (https://groups.google.com/forum/#!forum/js-test-driver). > > If you're trying to test node javascript, I would recommend switching from > JSTestDriver to something focused on node, like mocha. > > -- peter > -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- 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. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/8fa5338f-06b9-4f88-b857-01e52573eab6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[nodejs] node server using 80% CPU
I have a RESTful node server. Clients send requests which all translate to SOAP calls. The SOAP server and node server all both on the same machines. One HTTPS request, all are HTTPS, can translate into up to 7 SOAP calls. When the client puts the auto refresh on, every 5 seconds a series of requests are sent to the node server. With 2 clients, auto refresh on, can add up to two dozens of SOAP calls, the node server, using top, goes up above 80%. How can I determine what is causing this CPU spike? 2 dozens of SOAP calls can cause this? -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- 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. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/7e8a8e8d-01a6-47fe-a593-fa199ed5d5c7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[nodejs] node.js and request wait time
Please help me understand what waiting time is in a HTTP request. I have a RESTful node.js server. Client makes a HTTPS get request, the node server has to make a couple of SOAP calls to a web service. When I look at this request/response timing using Chrome developer tools, I see time is 931 ms. Blocking is 0.578 ms Sending is 0.163 ms Receiving 0.590 ms Waiting is 929.936 ms Is the waiting the amount of time spent on the SOAP call? -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- 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. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/e6132667-916b-45d4-bbf7-321a4cc086a3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[nodejs] timing of async calls
my RESTful server has to make a ton of SOAP calls to a Web service and I want to measure how each of these SOAP call take. How do I do that precisely? -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- 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. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/ae8bc237-0c05-4c40-9aa6-804ca50084b2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[nodejs] how to sturcture this promise
I have a function that returns promiseA, it takes param1 and param2. If param2 is a number I need to return the promise. It is noop. I have a function that returns promiseB, it takes param1 and does what it does. I have a composite function finalPromise that returns promiseA.then().promiseB. What does the code for finalPromise look like? -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- 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. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/2bb22086-fcd0-42b6-9ffe-d04a6246795a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[nodejs] node module for AWS and Azure
I want to design an "interface" to load data to cloud services such as Amazon and Microsoft. I see AWS has a node API/module. Anyone has any experience in this area? Thoughts, pointers? -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- 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. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/fa1cf67a-97dd-4323-90a7-8ddfe1249c64%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[nodejs] what is this code doing?
I am seeing this code snippet in a logging node module and I do not understand what it is doing? Can you explain? var LEVEL = { "TRACE": 10, "DEBUG": 20, "INFO": 30, "WARN": 40, "ERROR": 50, "FATAL": 60 }; for (var l in LEVEL) { LEVEL[LEVEL[l].toString()] = l; } -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- 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. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/3b3190c8-0cff-441c-aaae-7045dd08602c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[nodejs] RESTful server and websockets
I feel that a server that provides a RESTFul API should not support websockets connections. Websocket connections implies stateful, server is aware of a persistent connection to a client. A RESTFul server implies that there is no notion of a client, only request and response and nothing more as it pertains to the client. We have a case where the clients, AngularJS code, communicates with a REST node server. Now we have a feature of server "updating" the clients of an event. Client can polls, very frequently, for the event happening. Or enter the websockets and the notion of publisher/subscriber. To provide that and to stay pure to the RESTFul premise, we can add a secondary node server for this purpose of pub/sub model. Am I the only one feeling like mixing RESTful API and websockets is mixing metaphors and should be avoided? Thoughts? -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- 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. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/16122e87-bab3-420b-b04f-e6f54734c2b4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[nodejs] RPC package
Needing to do some RPC calls from my node server. I have found a couple of packages to experiment with. One is dnode and the other is node-xmlrpc. Any good recommendations? -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- 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. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/55f863b1-59ed-440b-ab83-72512b124a43%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[nodejs] Re: RESTful server and websockets
I feel the way that websockets violate REST principle is the notion of the server knowing about a client and its "state" in the sense that the server is aware of a "persistent" client waiting for to be told of an event. this is different that the REST model of request/response. To me it is mixing stateless and stateful. Agree? On Thursday, August 28, 2014 2:08:35 AM UTC-7, Floby wrote: > > That first answer is right. The separation of both applications would be > motivated more by a difference in load usage and scalability options. > > WebSockets can somehow violate REST principles. It all depends on what > your resource is. REST works around resources YOU define. If you define > your resource to be a CRDT for example, then a websocket is perfectly fine > for it. However this is a very tiny use case. > > In your case, since you're only sending events, I would suggest using > EventSource (Server-Sent Events) instead. These do not involve HTTP > upgrades, are a very simpler protocol and only differ from usual HTTP by a > Content-Type header. EventSource doesn't violate REST principles since you > define your resource as being "the events in order from that starting > point". Since you're only getting notifications from that channel, updates > would be made using your existing RESTful interfaces. > > That's also how CouchDB _changes feed works and how hoodie.io is built. > > On Wednesday, 27 August 2014 21:38:03 UTC+2, greelgorke wrote: >> >> i'd go for a separate server. for several reasons, not only for >> separation of concerns. a rest-server and a pub/sub server can have >> differend load and usage profiles, and might need separate scaling >> strategies. >> >> Am Mittwoch, 27. August 2014 05:38:34 UTC+2 schrieb Reza Razavipour: >>> >>> I feel that a server that provides a RESTFul API should not support >>> websockets connections. >>> Websocket connections implies stateful, server is aware of a persistent >>> connection to a client. A RESTFul server implies that there is no notion of >>> a client, only request and response and nothing more as it pertains to the >>> client. >>> >>> We have a case where the clients, AngularJS code, communicates with a >>> REST node server. Now we have a feature of server "updating" the clients of >>> an event. Client can polls, very frequently, for the event happening. Or >>> enter the websockets and the notion of publisher/subscriber. To provide >>> that and to stay pure to the RESTFul premise, we can add a secondary node >>> server for this purpose of pub/sub model. >>> >>> Am I the only one feeling like mixing RESTful API and websockets is >>> mixing metaphors and should be avoided? >>> >>> Thoughts? >>> >>> >>> >>> -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- 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. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/5382f51a-a760-4a43-8f38-76eddfae686e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[nodejs] what is this code doing?
function Param(stringifiedValue) { if (!this instanceof Param) { return new Param(stringifiedValue); } this.value = stringifiedValue; } Is this only doing away with the user having to do a new? Can someone explain? -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- 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. To post to this group, send email to nodejs@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/1bfd195a-0f64-42dd-a52b-82cfeaae3284%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.