get-amd-module-type
Get the type of AMD module used for an AST node or within a file
npm install get-amd-module-type
Usage
var getType = require('get-amd-module-type');
getType('my/file.js', function(err, type) {
});
var type = getType.sync('my/file.js');
var type = getType.fromSource('define() {}');
var type = getType.fromAST(node);
The returned type
will be any of the following:
- 'named':
define('name', [deps], func)
- 'deps':
define([deps], func)
- 'rem':
define(function(require, exports, module){});
- 'factory':
define(function(require){})
- 'nodeps':
define({})
- 'driver':
require([deps], function)