This module packages up
ndarray and other related modules into a single include. The goal is to be a single-stop ndarray-based module (similar to SciPy).
Browserify scans for every module that is
require()d, so Browserify-ing the larger bundle ends up packaging up a bunch of things you don't need.
This module also includes code-generation, so you can generate your own version of the bundle that only includes the modules you need. This means you can work with the comprehensive bundle during dev, but swap it out for a compatible, minimal bundle when you know which modules you need.
When included as a Node module, the result is based on the
var ndarray = ;var arr1 = ;
However, other modules are included and added to this bundle, e.g.:
var matrix = ndarray; // included from the "zeros" modulendarray;
Some of the modules are grouped together by functionality:
; // included from the "ndarray-fft" module; // included from the "ndarray-convolve" module
The structure of the included modules is defined in
When bundling up using a tool like Browserify, you don't want to
require() modules that you're not using.
As such, you can generate code that just includes the modules you need. You'll probably do this as part of your build script (so
ndarray-bundle is only a dev-dependency):
var codeGen = ;codeGen; // writes to file, including all known modules by defaultvar jsCode = codeGen; // or get as string
To select certain packages, you can specify the packages you need by supplying an object argument:
The structure of this argument is recursive. If you want to pick and choose from sub-groups, then you can supply an object instead of
You can also enhance this structure with other modules, by providing a string:
The resulting code only references the modules you want, but it maintains the same data structure. This means that if you only reference
my-ndarray-bundle.js, then Browserify will only package up the modules you need.