Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

require.js dependency analysis tool

How to detect circular dependencies from a project built using requir.js?

For instance

/* File: MyView.js */
define(['backbone','views/myview','object_x'], function(BB,V,X){
   ...
});

/* File: Object_X.js */
define(['backbone','jquery','views/myview','object_x'], function(BB,$,V,X){
   ...
});

what I mean is that as the project gets bigger, manually inspecting each file becomes a hassle.

Edit: How about detecting redundant dependencies?

like image 220
user1406062 Avatar asked Jun 02 '13 20:06

user1406062


People also ask

What is RequireJS used for?

RequireJS is a JavaScript library and file loader which manages the dependencies between JavaScript files and in modular programming. It also helps to improve the speed and quality of the code.

What is a RequireJS module?

RequireJS is a JavaScript file and module loader. It improves perceived page load times because it allows JavaScript to load in the background. In particular, it enables asynchronous JavaScript loading.

Should I use RequireJS?

RequireJS is a basic loader, which is used to loads the JavaScript files, it is a framework to manage dependencies between JavaScript files, and in modular programming, all the functionality divides in different modules, so RequireJs is a best tool to assemble different JavaScript files from different modules by which ...

What is Shim RequireJS?

Shim is a mechanism that RequireJS provides in order to support libraries and scripts that do not express their dependencies via define() . In other words, shim is there for traditional scripts not supporting definition of AMD modules.


1 Answers

I Googled your title word-for-word, and this was the first result...

https://npmjs.org/package/madge

like image 95
ken Avatar answered Oct 11 '22 21:10

ken