tagged [node.js]

Mongoose use of .select() method

Mongoose use of .select() method I'm pretty confused with the use of the `select` method. This is how I use it, and it's wrong: What I'm trying to achieve is simply to select from the transactions in ...

3 Mar at 17:30

"Cannot GET /" with Connect on Node.js

"Cannot GET /" with Connect on Node.js I'm trying to start serving some static web pages using `connect` like this: So I added a simple `index.html` at the `/public` directory on the same directory

9 Mar at 00:52

Sending data through POST request from a node.js server to a node.js server

Sending data through POST request from a node.js server to a node.js server I'm trying to send data through a `POST` request from a node.js server to another node.js server. What I do in the "client" ...

19 Mar at 10:2

What is the difference between __dirname and ./ in node.js?

What is the difference between __dirname and ./ in node.js? When programming in Node.js and referencing files that are located somewhere in relation to your current directory, is there any reason to u...

25 Mar at 14:19

What is an example of the simplest possible Socket.io example?

What is an example of the simplest possible Socket.io example? So, I have been trying to understand Socket.io lately, but I am not a supergreat programmer, and almost every example I can find on the w...

28 Mar at 20:3

Connecting client to server using Socket.io

Connecting client to server using Socket.io I'm relatively new to node.js and it's addons, so this is probably a beginnersquestion. I'm trying to get a simple HTML page on a webserver connect to a dif...

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

NPM clean modules

NPM clean modules Is there a way to get npm to unbuild all the modules under node_modules? Something like npm rebuild that removes all build artifacts but doesn't rebuild them?

5 Jul at 20:5

callback to handle completion of pipe

callback to handle completion of pipe I am using the following node.js code to download documents from some url and save it in the disk. I want to be informed about when the document is downloaded. i ...

12 Jul at 08:31

Formatting ISODate from Mongodb

Formatting ISODate from Mongodb In Mongodb I am storing date and time in ISODate format. Which looks like this Using nodejs/javascript, how can I display the time component so I would get something li...

14 Jul at 19:35

Embedding a lightweight web server into a .net application (node.js)?

Embedding a lightweight web server into a .net application (node.js)? I have a project built with Awesomium built in .NET and it requires the use of Flash. Flash throws security errors trying to acces...

Changing Node.js listening port

Changing Node.js listening port I just installed node.js on Windows. I have this simple code which does not run: I get: Error: listen EADDRINUSE Is there a that tells node.js to listen on a specific p...

29 Aug at 15:25

how to get request path with express req object

how to get request path with express req object I'm using express + node.js and I have a req object, the request in the browser is /account but when I log req.path I get '/' --- not '/account'. ``` //...

21 Sep at 07:32

NPM global install "cannot find module"

NPM global install "cannot find module" I wrote a module which I published to npm a moment ago (https://npmjs.org/package/wisp) So it installs fine from the command line: `$ npm i -g wisp` However, wh...

26 Sep at 07:44

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

How do you reinstall an app's dependencies using npm?

How do you reinstall an app's dependencies using npm? Is there a simple way to reinstall packages that my app depends on (i.e. they are in my apps node_modules folder)?

12 Oct at 20:18

How to extract request http headers from a request using NodeJS connect

How to extract request http headers from a request using NodeJS connect I'd like to get the "Host" header of a request made using Node JS's connect library bundle. My code looks like: The documentatio...

30 Oct at 21:30

Combine two OR-queries with AND in Mongoose

Combine two OR-queries with AND in Mongoose I want to combine two OR-queries with AND in Monoose, like in this SQL statement: I tried this in a NodeJS module which only gets the model object from the ...

7 Nov at 15:29

How to get a Node.js REST client to be able to communicate with a ServiceStack JSON Service

How to get a Node.js REST client to be able to communicate with a ServiceStack JSON Service I'm having issues getting a rest client written in Node.js to be able to send data (via GET) to a ServiceSta...

10 Nov at 01:20

NodeJS w/Express Error: Cannot GET /

NodeJS w/Express Error: Cannot GET / This is what i have, the filename "default.htm" actually exists and loads when doing a readFile with NodeJS. The Error (in browser):

12 Nov at 07:22

Node.js, can't open files. Error: ENOENT, stat './path/to/file'

Node.js, can't open files. Error: ENOENT, stat './path/to/file' I have developed a node.js program using the express framework on my computer, where it runs fine with no complaints. However, when I ru...

24 Nov at 14:3

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

Node.js create folder or use existing

Node.js create folder or use existing I already have read the documentation of Node.js and, unless if I missed something, it does not tell what the parameters contain in certain operations, in particu...

4 Dec at 04:34

How to sort a collection by date in MongoDB?

How to sort a collection by date in MongoDB? I am using MongoDB with Node.JS. I have a collection which contains a date and other rows. The date is a JavaScript `Date` object. How can I sort this coll...

12 Dec at 20:18

Fast way to concatenate strings in nodeJS/JavaScript

Fast way to concatenate strings in nodeJS/JavaScript I understand that doing something like It is relatively very slow, as the browser does that in `O(n)` . Is there a faster way of doing so without i...