node package manager



wrap a commonjs module to module-wrapping/module-transport style

var wrapper = require("module-wrapper");

wrapper.wrap("a.js", {
}, function(err, content){
	// use the content
- id: `id` of the module, it passed will result
- define: `define` function for your loader, defaults to "define"
- render: render function accept arguments and output the final code


var b = require("b");
var c = require("c");


define(["b", "c"], function() {
var b = require("b");
var c = require("c");

the render function accept an option argument which contains fields as below:

- define: the define function name
- code: the raw origin code
- deps: the dependencies of the module
- id: the identifier of the module
- SyntaxError: throw when fail to pass module dependencies
- AreadyWrappedError: throw when module is already wrapped