Skip to content
Advertisement

Tag: node.js

When to close MongoDB database connection in Nodejs

Working with Nodejs and MongoDB through Node MongoDB native driver. Need to retrieve some documents, and make modification, then save them right back. This is an example: With asynchronous nature, if the process of updating the document takes longer, then when cursor reaches the end of documents, database connection is closed. Not all updates are saved to the database. If

Remove a value from an array in CoffeeScript

I have an array: How could I check if “World” is in the array? Then remove it if it exists? And have a reference to “World”? Sometimes maybe I wanna match a word with a regexp and in that case I won’t know the exact string so I need to have a reference to the matched String. But in this

Create Instagram-esque filters with javascript?

Can I create Instagram-esque filters with javascript? The images can be processed client-side or server-side(node.js) I could overlay some pngs and box-shadows with css to get a limited amount of similar effects, but I was wondering if there was anything out there that can truly process images like this in js. Thanks! Answer I ended up finding this, http://vintagejs.com/

How can I ‘require’ CommonJS modules in the browser? [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago. Improve this question What is the best way to load CommonJS modules as client-side JavaScript code in the browser? CommonJS modules put their functionality

Error: Can’t set headers after they are sent to the client

I’m fairly new to Node.js and I am having some issues. I am using Node.js 4.10 and Express 2.4.3. When I try to access http://127.0.0.1:8888/auth/facebook, i’ll be redirected to http://127.0.0.1:8888/auth/facebook_callback. I then received the following error: The following is my code: May I know what is wrong with my code? Answer The res object in Express is a subclass of

Advertisement