Node.js

Node.js is a platform built on Chrome's JavaScript runtime for easy building of fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

Debian packages to install

2018-01-22: please enumerate exactly which Debian packages to install, to get the following commands to work correctly

Packaging modules

On Debian systems up to and including Stretch (Debian 9), Node.js modules are located in:

/usr/lib/nodejs/<module_name>

For Debian Buster (to become Debian 10), Node.js modules are now located in:

/usr/lib/node/<module_name>

For more information about packaging a node module for Debian (and the reasons for the change of location for nodejs modules) please take a look at these pages:

Complex modules

For complex modules, which have many dependencies to be satisfied, you may want to track your work in this wiki in order to keep javascript team updated about.

For more information, please take a look at Tasks page.

Using build tools like grunt

   1 override_dh_auto_build:
   2         grunt build

   1 override_dh_auto_build:
   2         gulp build

   1 override_dh_auto_build:
   2         babeljs src -d lib

Use this as debian/webpack.config.js

   1 'use strict';
   2 
   3 var fs = require('fs');
   4 var path = require('path');
   5 var webpack = require('webpack');
   6 
   7 var config = {
   8 
   9   target: 'web',
  10   resolve: {
  11     modules: ['/usr/lib/nodejs', '.'],
  12   },
  13   resolveLoader: {
  14     modules: ['/usr/lib/nodejs'],
  15   },
  16   node: {
  17     fs: 'empty'
  18   },
  19   output: {
  20     libraryTarget: 'umd'
  21   },
  22   module: { rules: [ { use: [ 'babel-loader' ] } ] }
  23 }
  24 
  25 module.exports = config;

and call webpack from debian/rules

   1 override_dh_auto_build:
   2         webpack --config debian/webpack.config.js lib/Yaml.js dist/Yaml.js --output-library=Yaml

   1 override_dh_auto_build:
   2         cake.coffeescript build

TODO: make debhelper autodetect grunt, gulp and cake.