amd-parser

0.1.0 • Public • Published

amd-parser NPM version Build Status Dependency Status

Installation

$ npm install amd-parser --save

Usage

var parser = require('amd-parser');
 
var ast  = require('esprima').parse('define('module', ['util'], function(util) { return {}; })');
 
var modules = parse.parse(ast);
assert(modules.length == 1);
var mod = modules[0];
 
mod.id; // module
mod.node; // define function node
mod.simpleObject; // true if AMD is a simpleObject/dependency free module
mod.normalized; // true if AMD is just a commonjs wrapper module
mod.returns; // return statements in a standard module
mod.factoryNode; // ast node for factory function
 

Licence

MIT

/amd-parser/

    Package Sidebar

    Install

    npm i amd-parser

    Weekly Downloads

    1

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • villadora