am-transport

module wrapper with all kinds of module package

am-transport is a fast and efficient Node.js library for transport am project codes to all kinds of module files.

Node.js 0.8.0+ (tested on CentOS, Ubuntu, OS X 10.6+, and Windows 7+)
npm install am-transport

am-transport accepts the following command line arguments (please make sure you use <source-file> as the very last argument to avoid potential issues):

 
  Usage: amtrans [options] source-file
 
  Options:
 
    -h, --help                  output usage information
    -v, --version               output the version number
    -d, --debug                 open debug mode
    -f, --family [family-name]  family name AJ AW AB, AMUI,which one? AJ default
    -o, --output [output-file]  Use [output-file] as output instead of STDOUT
    -u, --uglify                use uglifyjs minify js
    -w, --loader                module loader windows default

To transport a mod.js file into aj-mod.js do:

amtrans -o aj-mod.js  mod.js
var AMTransport = require('am-transport');
var source = 'alert("hellworld");module.exports=helloworld';
var transportjs = new AMTransport().transport(source);

AMTransport constructor accepts a hash as a parameter, i.e., new AMTransport(options).transport(source) with the following options available:

  • loader - module loader (default : windows) options:amd,cmd,code etc
  • uglify - whether to use uglifyjs minify js(default : false)
  • family - am project namespace