Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world.

Share tech news, updates, or what's on your mind.

Sign up to Post

I successfully got this example to work on my Windows 10 pc. (thanks to help from Expert it_saige)¬ificationFollowed=191140277#a42185760

I now want to host it on a GoDaddy hosting account I just signed up for.

I've never setup a Node.js website before - though I have worked with IIS/ASP sites for years.
Is it just a matter of copying the files to a particular folder (eg. root)?

Thanks for any help.
What is SQL Server and how does it work?
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

I'm trying to run this example here (of an HTML5 application)

It needs to run on Node.js - I am unfimilar with Node.js. (though ok with IIS)

I have downloaded Node.js and installed it. I have downloaded the ZIP file from GitHub.

Can someone please give me a step-by-step to enable me to open/run this one-page web file?

A demo is here
(pretty cool if you're a musician)

I am trying to connect to MongoDB in mongoDBatlas from my javascript but I keep getting the following error.

MongoError: connection 5 to closed
    at Function.MongoError.create (C:\Users\558642\ga\js-dc-5\11-crud-and-dbs\assignment\todo\node_modules\mongodb-core\lib\error.js:29:11)
    at TLSSocket.<anonymous> (C:\Users\558642\ga\js-dc-5\11-crud-and-dbs\assignment\todo\node_modules\mongodb-core\lib\connection\connection.js:202:22)
    at Object.onceWrapper (events.js:293:19)
    at emitOne (events.js:101:20)
    at TLSSocket.emit (events.js:191:7)
    at _handle.close (net.js:511:12)
    at Socket.done (_tls_wrap.js:332:7)
    at Object.onceWrapper (events.js:293:19)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at TCP._handle.close [as _onclose] (net.js:511:12)

Here's my code
const express = require('express')
const hbs = require('express-handlebars')
const mongoose = require('mongoose')
const bodyParser = require('body-parser')


const itemEntry = require('./models/toDoEntry.js')
const app = express()

app.get('/', function( req, res ) {
	itemEntry.find({}, function( err, itemEntries ) {

Open in new window

I am looking into Webpack 2 Code Splitting for a project but I'm not sure if I understand how code splitting works.

In my project I have 2 features.

Each feature consists of 4 or 5 files so the code for each feature has several javascript files where the code lives.

These javascript files are NOT ES6 Modules, just standard javascript files with code.

With Webpack 2 Code Splitting I intend to break all these files into 2 groups so that can load them on demand when needed.

So, what I'm thinking of doing with it is ...

1. Project Loads just the core

2. On demand the features will load when needed.

Would code splitting work in this circumstance and is this what it's for?
I am working on a project using, node, Webpack, babel and ES6.

Inside my project I've created a module which I want to load into the project at runtime.

The end result I'm looking for is that when the application will have different features. The code for each feature will be in a module.

The user can then enable or disable certain features at runtime.

How can I do this?
As a junior, I'm a bit new to front end programming (crammed learning JS/other languages/NPM/NodeJS/etc within three months for my current role) so apologies if what I say doesn't make sense.

I've helped to build a UI for an application with the use of NPM/Node JS. The application stores data on a UNIX server. The UI accesses the data on the server (https://myhostname:8090/blah/blah) and presents the results with a nice UI. With the help of GIT, I've managed to do move all the src UI code onto the UNIX server. The purpose is for automation

While a specific file (in my UI code) specifies the UNIX server configuration, I've used NPM to build a bundle.js (Which bundles all the JS files into a single file) file. I move this bundles.js along with the index.html and CSS styling files to an appropriate directory in order to use Maven to build a JAR file. And with a start/stop server script to run the process to run  the code, I can just enter the UNIX hostname/port number in my browser window in order to access the UI and data. This all works.

However. I now need to generalise the server configuration in my bundle.js file as well as properties file on server side such that I'm not hard coding server configuration anywhere (meaning I can deploy the UI on any server with no issue). i.e. playing with "localhost" instead of the actual server hostname etc.

I want to try my best, but I need to acknowledge that I have no real server configuration experience and hence need a …
I'm trying to setup a new webrtc instance behind the firewall where tcp 80 and 443 ports are only available.
All is fine as long as udp ports are enabled. Once I block udp, I can't establish a client connection.
The stun/turn server has been setup however connections are not redirected from webrtc.

RTCMultiConnection.js config:

var IceServersHandler = (function() {
        function getIceServers(connection) {
            var iceServers = [];
iceServers.push(getTURNObj('', 'user', 'pass'));
            if (window.RMCExternalIceServers) {
                iceServers = iceServers.concat(getExtenralIceFormatted());
            } else if (typeof window.getExternalIceServers !== 'undefined' && window.getExternalIceServers == true) {
                connection.iceServers = iceServers;
                window.iceServersLoadCallback = function() {
                    connection.iceServers = connection.iceServers.concat(getExtenralIceFormatted());

            return iceServers;

        return {
            getIceServers: getIceServers

turnserver.conf config


All is running in AWS cloud.

Which Database Choose?

This Article about choose the NOSQL database based on application requirement. Different NoSQL DB’s available, there are three primary concerns you must balance when choosing a data management system: consistency, availability, and partition tolerance.


* Consistency means that each client always has the same view of the data. * Availability means that all clients can always read and write.

* Partition tolerance means that the system works well across physical network partitions.


Chose the Database system based on your application requirement.

 Example Comparing MongoDB and CouchDB.

As you can see in the diagram, MongoDB and CouchDB are built with a slightly different focus. Both scale across multiple nodes easily, but MongoDB favours consistency while CouchDB favours availability.

In the MongoDB replication model, a group of database nodes host the same data set and are defined as a Replica set. One of the nodes in the set will act as primary and the others will be secondary nodes. The primary node is used for all write operations, and by default all read operations as well. This means that replica sets provide strict consistency. Replication is used to provide redundancy - to recover from hardware failure or service interruptions.

CouchDB uses a replication model called Eventual consistency. In this system, clients can write data to one node of the database without waiting for other nodes to come into agreement. The …

In Facebook, 1000's of people can like or frown or comment on certain columns.

In the Facebook API, am I able to easily message those people interested in the topic? are there ways, Apps to do this? Any costs?

This message page suggests billions? Really . . . .? . . .  here

Do I need to use Java or PHP coding in any way?

I am learning Angular, Node, npm, deployd, mongodb, etc.  I am making my way through a book titled "Pro AngularJS" by Adam Freeman.

on page 120 I am attempting to prepare the data for a "real world" application called "sportsstore".

I was instructed to install a module called "deployd" which apparently is used for modelling  API's for web applications.

I did that and when I try to start start the "deployd" service I get an error:

C:\PROGRA~2\deployd>dpd -p 5500 sportsstore\app.dpd --mongod
starting deployd v0.8.9...
  var err = this._handle.spawn(options);

TypeError: Bad argument
    at TypeError (native)
    at ChildProcess.spawn (internal/child_process.js:289:26)
    at exports.spawn (child_process.js:380:9)
    at Object.exports.restart (C:\Users\knowlton\AppData\Roaming\npm\node_modules\deployd\lib\util\mongod.js:38:14)
    at Command.start (C:\Users\knowlton\AppData\Roaming\npm\node_modules\deployd\bin\dpd:149:16)
    at Command.listener (C:\Users\knowlton\AppData\Roaming\npm\node_modules\deployd\node_modules\commander\index.js:301:8)
    at emitOne (events.js:96:13)
    at Command.emit (events.js:188:7)
    at Command.parseArgs (C:\Users\knowlton\AppData\Roaming\npm\node_modules\deployd\node_modules\commander\index.js:617:12)
    at Command.parse (C:\Users\knowlton\AppData\Roaming\npm\node_modules\deployd\node_modules\commander\index.js:458:21)
    at Object.<anonymous> 

Open in new window

Office 365 Training for Admins - 7 Day Trial
Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Hello Exchange Experts,

I have 1 DAG with 4 nodes with Exchange 2013, I would like to know if I could create 1 BD for my heath mailbox, I have read that is not a best practice to move them, but for my administration could be better. So my questions:
*  The health mailbox has to be local in each node? or I could have them all in one server
* Could I move the health mailbox to another DB, and another disk unit, in the same node?

Thanks a lot!
Hi All,

I have a 2 node hyper v cluster running a bunch of virtual machines.

I can successfully connect to the cluster via failover cluster manager with no issues. I have run the validate cluster tool which passes successfully also

When I right click on a node and select 'connect' I get the console window as expected, however it only works on hyper v host 1 not hyper v host 2.

When I also try and connect to the problem host via Hyper-V manager I receive the following:

Any suggestions?
Hello experts,

Is there any way to handle cuss words in
 Nodejs application.

Thank you
I have to write a Node.JS application that connects to a remote server.  The remote server has a login manager that authenticates my session then spawns a separate process to handle the rest of my session.  The way that works is that I have to make a non-SSL network connection to the login manager and do an initial unprotected handshake.  The lets the client and server negotiate if they will be doing SSL or plain text communications.  If SSL then I need to elevate my socket to an SSL socket, send my login and password along with some other initial information, then get a success of failure message back from the login manager.  If success then I know the login manager is starting a new process and handing off my open socket connection to that new process.  Since the server can't pass the SSL context it de-elevates the SSL connection and runs a program passing it the non-SSL open socket.  Then the new program creates it's own SSL context on the open socket. So in my Node.JS code I need to close the SSL socket but leave the raw socket open.  The new program will send me a success message when it is up and running at which time I need to re-elevate my open socket to SSL again.

My question is how can I close an SSL socket leaving the raw socket open so I can continue to use the raw socket and then re-elevate it to SSL again?
I have node installed on my laptop.

I have a folder that I want to use for my testing of angular:


node is installed here:


From within the nodejs directory I want to be able to start an http server like this:

C:\programfiles\nodejs> node server.js

which would start the http server and just wait, listening on some port like 5000

then, in a web browser like Chrome, I want to navigate to localhost and load an HTML file:


But the test.html file resides at this location:


I've been doing lots of reading on "express" and "connect" middleware, but I just can't seem to make it work.

For example:

I ran the following:

npm install connect -g


npm install serve-static -g

and then ran "node server.js"


var connect = require('connect');

var serveStatic = require('serve-static');

connect.createServer( serveStatic("../angularjs") ).listen( 5000);

Open in new window

gives this error:

TypeError: connect.createServer is not a function
I have a node.js module that needs unit test. Here is the key relevant code:

old code:
                const memsqlPool = {
                    execute: sandbox.stub().resolves(!mockPara || mockPara.memSqlResult || ''),
                sandbox.stub(my-lib.memsql, 'Pool', constant(memsqlPool));

In the source code:

const {memsql} = require('my-lib');
const memsqlPool = new memsql.Pool(my-config);
        function getInfo(id){
            return memsqlPool.execute(my-arguments).then(my-mapping-object);

This code actually hints that memsqlPool.execute() can only be called once in any given test case, because it always returns the same results.
Now I have to make two memsql calls, one depends on another.  I try to make it something like:


But just do not know how to fit this idea into the unit test code above.

Anyone can help?
I need a identity server for Node.js that works with relational databases
Below is my  code,Can   anyone please  tell me why my window.onload function  does not  work? I am javascript newbie

// performs an AJAX get call asynchronously and puts the result into an element
function ajaxAsync(url, elementId) {
    var ajax = createAjaxRequestObj();
    ajax.onreadystatechange = function() {
        if (ajax.readyState == 4) {

//Here is my window.onload function
            window.onload = function(){
                document.getElementById(elementId).innerHTML = ajax.status == 200 || ajax.status == 304 ? ajax.responseText : "(an error has occurred - please try refreshing the page - " + ajax.status + ")";
            if (finishLoad) {
    }"GET", randomizeUrl(url), true);

Open in new window

A simple login application using Node JS, Mongo DB and Express frameworks. There are tons of tutorials on Node JS and Express but most of the use extensive plugins which would confuse the beginners, the primary motive of this article is to ensure it captures the bare minimal functionality.
2017 Webroot Threat Report
2017 Webroot Threat Report

MSPs: Get the facts you need to protect your clients.
The 2017 Webroot Threat Report provides a uniquely insightful global view into the analysis and discoveries made by the Webroot® Threat Intelligence Platform to provide insights on key trends and risks as seen by our users.

best way to have users and roles and authenicate based on these users and  roles  and based in nodejs apis?
I am a relative newbie to node.js and typescript and am looking for tutorials and examples for building custom libraries for typescript. I am currently working on a project(switched to webstorm GUI) that requires I build several microservices and several of the microservices will need to share certain code, i.e., base repository functionality, etc. My though would be to move the code they have in common to a series of separate libraries(projects) and make them into typings and have the projects that need them to install them. Following the example I found here, and using grunt: What is the story for creating and consuming TypeScript libraries?, I was able to generate the .js file and the .d.ts files in a dist folder on the project. There are a few areas that I am confused about:

1) The example makes reference to a "main": "./dist/my.service.js" section in the jsconfig file, how necessary is this file and what should go into it?

2) If all of the files are transpiled and added to the dist folder, will the dependent code still be able to access it or do I have to transpile all of the files to root?

3) After I have have all of the file successfully transpiled and moved to the proper location, how do I install them to the dependent project if they are local and not up on the npm or Definitely Typed, etc.?
After upgrading to node.js 7.5.0, I encountered this error too:  Loading "grunt-karma.js" tasks...ERROR >> TypeError: Cannot read property 'prototype' of undefined
Hi Team,

I have a 2 node hyper V cluster running on windows server 2012 R2 ,i wanted to convert present LUN to CSV but i am not getting the option.

npm version
$ npm -v

node version
$ node -v

$ npm install -g xsl-transform
npm http GET
npm http 304
npm http GET
npm http GET
npm http 304
npm http 304

> node_xslt@0.1.9 preinstall C:\Users\TEMP.Rumba-DEV.010\AppData\Roaming\npm\node_modules\xsl-transform\node_modules\node_xslt
> node-gyp rebuild

C:\Users\TEMP.Rumba-DEV.010\AppData\Roaming\npm\node_modules\xsl-transform\node_modules\node_xslt>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
gypnpm ERR! node_xslt@0.1.9 preinstall: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the node_xslt@0.1.9 preinstall script.
npm ERR! This is most likely a problem with the node_xslt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls node_xslt
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "xsl-transform"
npm ERR! …
I am trying to generate a pdf file from a dynamic handlebar webpage that would display data from the database. Once I get this to work on my local machine, I would like to move the code up to elastic beanstalk. The code seems to run that initially makes the call to spawn, however, call to phantomjs does not seem to kick off the script passed to it. Just to confirm, I added a console.log statement at the very beginning of the file and never the print out. Not to mention the other print statement in the script file. The code is below:

code that performs the spawn:
var childArgs = [
                  path.join(__dirname, '../phantom/capture.js'),

            let child = spawn(phantomjs.path, childArgs, {detached: false});

            console.log('set up stderr.....');
            child.stderr.on('data', (data) => {
              console.log('ps stderr: ${data}');

            console.log('set up stdout.....');
            child.stdout.on('data', (data) => {
              console.log('ps stdout: ${data}');

            console.log('set up close.....');
            child.on('close', (code) => {
                console.log('this is a test 2.....');
                if (code !== 0){
                    let error = new Error('An error occurred while creating the current report.');

Open in new window







Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world.

Top Experts In