9

Is there a program/tool that can generate function dependency graph for javascripts? Basically, the input should be a folder of javascript files, then the output is a nice graph that show all the relations between each function. It'll be better if I can interact with the graph, also.

Is there a way to do that?

Thanks

1 Answer 1

2

On windows and Visual Studio you can look at JSAnalyse: http://jsanalyse.codeplex.com/

I haven't tried it, but from the description, it parse the JavaScript files and creates a dependency tree of the different files based on the static references between them.

The project

JSAnalyse is a tool to analyze the dependencies between JavaScript files and keep them under control. It helps to visualize and handle static references between JavaScript files in order to ensure the defined client-side architecture.

In the last couple years the amount of JavaScript lines in web applications has been dramatically increased. A lot of new client-side frameworks (like JQuery, Knockout, etc...) have aroused, but the tools for developing JavaScript just got slightly better. For instance, the Visual Studio 2010 has improved the IntelliSense. But for a well-designed application, not only the server-side code is relevant anymore. It is also very important to have a good architecture for the client-side code and to keep it in a healthy and good state during the whole application lifecycle. That is exactly when JSAnalyse comes into play. It enables not just the possibility to analyze the existing JavaScript dependencies but also to constrain them. The allowed dependencies can be either configured via XML or by using the great Visual Studio 2010 Architecture features. JSAnalyse provides an extension for the Visual Studio Layer Diagram to validate and control also dependencies between JavaScript files. This can be integrated into the build and with the Gated Check-in feature it is not even possible to check-in source code which does not fulfill the JavaScript architectural rules.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks. This one I tried but didn't work. I followed the instruction and dragged in all the javascript files but it didn't create any dependency info.
I tried a sample projet and works with it; can you give me a sample dependency files?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.