Nodejs Notes - newgeekorder/TechWiki GitHub Wiki

Node version management

Node Api

Testing

Mocha running individual tests - using the grep option to select the tests

mocha -g "Else"

Building

  • Gulp - is a streaming build file for node
  • "Browserify lets you require('modules') in the browser by bundling up all of your dependencies." often used with gulp
var browserify = require('browserify');
var gulp = require('gulp');
var source = require('vinyl-source-stream');

gulp.task('browserify', function() {
    return browserify('./src/javascript/app.js').bundle()
        // vinyl-source-stream makes the bundle compatible with gulp
        .pipe(source('bundle.js')) // Desired filename
        // Output the file
        .pipe(gulp.dest('./build/'));
});

Learning

Links and Ref

  • Intelij Note: endure "File-> settings -> Languages and Settings -> Javascript -> Libraries" and ensure the nodejs libraries are included