tagged [node.js]

How to process POST data in Node.js?

How to process POST data in Node.js? How do you extract form data (`form[method="post"]`) and file uploads sent from the HTTP `POST` method in [Node.js](http://en.wikipedia.org/wiki/Node.js)? I've rea...

3 Jan at 22:4

How to fix curl: (60) SSL certificate: Invalid certificate chain

How to fix curl: (60) SSL certificate: Invalid certificate chain I get the following error running `curl https://npmjs.org/install.sh | sh` on Mac OSX 10.9 (Mavericks): How do I fix this?

31 Oct at 17:13

How to return values from async functions using async-await from function?

How to return values from async functions using async-await from function? How can I return the value from an async function? I tried to like this it returns me this,

How to get GET (query string) variables in Express.js on Node.js?

How to get GET (query string) variables in Express.js on Node.js? Can we get the variables in the query string in Node.js just like we get them in `$_GET` in PHP? I know that in Node.js we can get the...

4 May at 12:1

Convert Mongoose docs to json

Convert Mongoose docs to json I returned mongoose docs as json in this way: However, user.__proto__ was also returned. How can I return without it? I tried this but not worked:

31 Mar at 09:28

require file as string

require file as string I'm using node + express and I am just wondering how I can import any file as a string. Lets say I have a txt file all I want is to load it into a variable as such. I am against

5 Oct at 19:11

Node.js project naming conventions for files & folders

Node.js project naming conventions for files & folders What are the naming conventions for files and folders in a large Node.js project? Should I capitalize, camelCase, or under-score? Ie. is this con...

Node.js Mongoose.js string to ObjectId function

Node.js Mongoose.js string to ObjectId function Is there a function to turn a string into an objectId in node using mongoose? The schema specifies that something is an ObjectId, but when it is saved f...

5 Jul at 05:15

convert string to number node.js

convert string to number node.js I'm trying to convert req.params to Number because that is what I defined in my schema for year param. I have tried and and but non of them works. Do I need to install...

17 May at 08:58

How to sort in mongoose?

How to sort in mongoose? I find no doc for the sort modifier. The only insight is in the unit tests: [spec.lib.query.js#L12](https://github.com/Automattic/mongoose/blob/13d957f6e54d6a0b358ea61cf943769...

13 Dec at 08:15

Print a list of all installed node.js modules

Print a list of all installed node.js modules In a node.js script that I'm working on, I want to print all node.js modules (installed using npm) to the command line. How can I do this?

node.js - how to write an array to file

node.js - how to write an array to file I have a sample array as follows I would like to write this array to a file such as I get a f

12 Jul at 14:24

Passing variables to the next middleware using next() in Express.js

Passing variables to the next middleware using next() in Express.js I want to pass some variable from the first middleware to another middleware, and I tried doing this, but there was "`req.somevariab...

How to split string with newline ('\n') in Node?

How to split string with newline ('\n') in Node? Within Node, how do I split a string using newline ('\n') ? I have a simple string like `var a = "test.js\nagain.js"` and I need to get `["test.js", "a...

20 Apr at 23:46

In nodeJs is there a way to loop through an array without using array size?

In nodeJs is there a way to loop through an array without using array size? Let's say I have I tried It prints 0 1 What I wish is to have item1 item2 Is there any other syntax that works witho...

1 Apr at 20:22

javascript node.js next()

javascript node.js next() I see a lot of use `next` in node.js. What is it, where does it come from? What does it do? Can I use it client side? Sorry it's used for example here: [http://dailyjs.com/20...

21 Mar at 22:44

How to install a node.js module without using npm?

How to install a node.js module without using npm? There are quite a few modules which are listed [on node's github page](https://github.com/joyent/node/wiki/modules) but are not published with the np...

2 Dec at 04:0

What is Express.js?

What is Express.js? I am a learner in [Node.js](http://en.wikipedia.org/wiki/Node.js). 1. What's Express.js? 2. What's the purpose of it with Node.js? 3. Why do we actually need Express.js? How is it ...

24 Aug at 15:30

Copy folder recursively in Node.js

Copy folder recursively in Node.js Is there an easier way to copy a folder and all its content without manually doing a sequence of `fs.readir`, `fs.readfile`, `fs.writefile` recursively? I am just wo...

22 Aug at 20:44

req.query and req.param in ExpressJS

req.query and req.param in ExpressJS ## Main differences between req.query and req.param in Express - - Suppose android sends a POST request -> Intention is to send (Key,Value) to client and the serv...

29 Oct at 19:57

After installation of Gulp: “no command 'gulp' found”

After installation of Gulp: “no command 'gulp' found” After installing [gulp.js](http://gulpjs.com/) via npm, I receive a `no command 'gulp' found` error when running the `gulp` command from the same ...

26 Apr at 00:56

Is it possible in .NET, using C#, to achieve event based asynchronous pattern without multithreading?

Is it possible in .NET, using C#, to achieve event based asynchronous pattern without multithreading? I am amazed by the architectural design of [Node.js](http://en.wikipedia.org/wiki/Node.js) and was...

node.js - request - How to "emitter.setMaxListeners()"?

node.js - request - How to "emitter.setMaxListeners()"? When I do a GET on a certain URI using the node.js 'request' module; ``` "(node) warning: possible EventEmitter memory leak detected. 11 listene

22 Feb at 21:54

How to tell eslint that you prefer single quotes around your strings

How to tell eslint that you prefer single quotes around your strings I'm new to eslint and it's spewing out a ton of errors telling me to use doublequotes: That's not my preference. I've got an .eslin...

28 Mar at 02:21

How to append to a file in Node?

How to append to a file in Node? I am trying to a string to a log file. However writeFile will erase the content each time before writing the string. Any idea how to do this the easy way?

8 Jul at 18:6