How can one extract a list of all modules from a project using RequireJS? I am interested in getting the structure of the project, looking at modules and their dependencies.
Asked
Active
Viewed 888 times
0
-
1Maybe this link will help you : [require.js: Access all loaded modules][1] [1]: http://stackoverflow.com/questions/11756483/require-js-access-all-loaded-modules – liorlis May 04 '15 at 09:20
-
Can you please be more elaborate in what do u exactly mean when you say"structure of the project". Do u want to get dependency graph of modules? – Vishwanath May 04 '15 at 12:56
-
liorlis thanks, I found an automated way to do that (see answer). @Vishwanath yes. By structure of project I meant module dependencies in order to plot them in a graph. See answer for more details on how it is done. – Dimosthenis Kontogiorgos May 04 '15 at 15:21
1 Answers
0
I found an NPM package called Madge that can do exactly that. You can extract your RequireJS module dependencies and graph them using Graphviz.

Dimosthenis Kontogiorgos
- 361
- 2
- 6
- 21