[nodejs] Use of global variable in node js

2017-03-27 Thread SURAJ KUMAR CHANDRA
How do you guys use node js vars.  Please refer to red marking. I am 
declaring variable at one place trying to use at another place, simply not 
working.

function login(email,password){ // Returns the login data row
  var email = email.trim().toLowerCase();
  var password = password.trim();

 var   result = [];  //*Declaring here* 

  //var queryString = "SELECT * FROM users where Email ="+"'"+email+"'"+ 
AND Password = +"'"+password+"'";
  var queryString = "SELECT * FROM users where Email ="+"'"+email+"' AND 
Password = '"+password+"'";

  //var execQuery = function execQuery(){
  con.query(queryString,function(err,rows){
  if(err) throw err;

 // console.log('Data received from Db:\n');
 //result = result.push('SUCCESS','','Data',rows)
 //console.log(rows);
result = rows;  // *Want to use here*
   //return rows;

});

 con.end(); 

//}
//console.log('Outside function block: '+execQuery());
return result; /*/ want to see here*
}

-- 
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/306be370-1c7e-474e-93f9-0069bf6ff190%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] platform

2017-03-27 Thread Jeremy Darling
2nd response from google for exactly that question answers this best:


(from
http://stackoverflow.com/questions/35238667/is-npm-dependent-on-the-os-of-a-computer
with slight inline edits)

The binary, npm, that you install is platform dependent, as is node.js.
That's why there are different releases for each platform available on the
download site.

For the most part, your project files are platform independent. For
example, most of your JavaScript files will all be used by node.js and work
just fine without having to worry about what platform you are on because
the system details will be dealt with by node.js itself.

However, some modules *are* platform dependent. For example, anything that
uses node-gyp will try to compile on your platform whenever the module is
installed by npm. You do not have to worry about that though because it is
handled by npm, that's why you're using a package manager.

Copying node_modules can be done; but it's more often than not better and
easier to just run npm i on whatever machine is going to be running your
application. You can avoid having to worry about version problems using
something like npm shrinkwrap  which
will lock down the version of a package that your module depends on.
share improve this answer

answered Feb 6 '16 at 8:24

zero298 
3,81731938

On Mon, Mar 27, 2017 at 1:07 PM,  wrote:

> hello
>
>
> Is node.js is platform dependent or independent ?
>
>
> --
> 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/8f8b4285-5374-4490-9b05-7b4217cdb37a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAAhs7Ei9tRkcLVBBjL5TPFYf7byYU40TfcKGfkpeTGDEETfQyA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[nodejs] NAN AsyncWorker vs libuv thread pool

2017-03-27 Thread Bill Klein
My understanding is that NAN's AsyncWorker makes use of libuv's thread pool 
which defaults to 4 threads. In my case, some of my node module's 
AsyncWorkers may run relatively long, though they are not CPU intensive, so 
I can't limit to 4 threads...

Is there any risk in increasing UV_THREADPOOL_SIZE to the max, apart from 
how my own AsyncWorkers behave? In the libuv documentation it says that, 
"the threadpool is global and shared across all event loops," so I assume 
that other things make use of it and will suffer from degraded performance 
if there are too many threads available to them...?

Thanks.

-- 
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/938ea43b-0058-4102-9472-f4074d21a365%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[nodejs] CRUD sample using Node and Mongo DB on the back end and JS on the front end

2017-03-27 Thread Giorgi
I wanted to share this  project of mine, which is a CRUD app with Node and 
Mongo DB on the back end and JS on the front end
https://github.com/giorgim/MovieManagementApp
Hope someone will find it useful.

-- 
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/68e253b6-e7fe-4b64-a584-324c40f336cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[nodejs] platform

2017-03-27 Thread htuwf25
hello


Is node.js is platform dependent or independent ?


-- 
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/8f8b4285-5374-4490-9b05-7b4217cdb37a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.