Tuesday, June 30, 2015

SocketIO on Windows



I found recently that I was unable to install SocketIO on my Windows development platform.

The installation will throw out some errors.

It turns out that EngineIO on npm is the older version and will not work with SocketIO.


The workaround is to :


npm install Automattic/engine.io-client --save
on your local node project.

SocketIO will work after that.

Wednesday, June 10, 2015

Babel NodeJS Starter project

This is a starter skeleton NodeJS that I built for my use. I hope you will find it useful as well.
The ES6 files that you write will reside in ES6 folder:
Do note that you will need to append the suffix "-ES6" to your file. For example
hello-ES6.js
gulp watch will pick up the change and transpile it to ES5 in ./dist folder.
the gulp file resides in the ./gulp folder.
Issue 'gulp build' to rebuild all files. 'gulp clean' removes the entire dist/ directory 'gulp watch' will compile files that are newly created or modified - this is the option that you would want to issue when coding as it will run in the background and automatically pick up any changes.
There are some sample ES6 files in ES6 folder and a sample index.js file to test the transpile.
The requirements for this are :
  • NodeJS
  • Gulp
  • Babel
In this cloned repository: issue
'npm init'
Node will download the required modules.

The location of the code is: