Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

madge

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

madge

Create graphs from module dependencies.

  • 3.5.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
597K
increased by5.49%
Maintainers
1
Weekly downloads
 
Created

What is madge?

Madge is a JavaScript library that helps you visualize and analyze the dependency graph of your project. It can be used to identify circular dependencies, generate dependency graphs, and more.

What are madge's main functionalities?

Generate Dependency Graph

This feature allows you to generate a dependency graph of your project. The code sample demonstrates how to use Madge to analyze the dependencies in a given project directory and output the result as an object.

const madge = require('madge');

madge('path/to/your/project').then((res) => {
  console.log(res.obj());
});

Identify Circular Dependencies

Madge can identify circular dependencies in your project. The code sample shows how to use Madge to find and log any circular dependencies in the specified project directory.

const madge = require('madge');

madge('path/to/your/project').then((res) => {
  console.log(res.circular());
});

Generate Graphviz DOT File

Madge can generate a Graphviz DOT file for visualizing the dependency graph. The code sample demonstrates how to generate and log the DOT representation of the dependency graph.

const madge = require('madge');

madge('path/to/your/project').then((res) => {
  return res.dot();
}).then((output) => {
  console.log(output);
});

Create an Image of the Dependency Graph

Madge can create an image file of the dependency graph. The code sample shows how to generate an image of the dependency graph and save it as 'graph.png'.

const madge = require('madge');

madge('path/to/your/project').then((res) => {
  return res.image('graph.png');
}).then((writtenImagePath) => {
  console.log('Image written to ' + writtenImagePath);
});

Other packages similar to madge

Keywords

FAQs

Package last updated on 07 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc