@wroud/di-tools-analyzer
TypeScript icon, indicating that this package has built-in type declarations

0.5.1 • Public • Published

@wroud/di-tools-analyzer

@wroud/di-tools-analyzer is a powerful tool designed to enhance your experience with the @wroud/di dependency injection library. This tool provides capabilities to analyze the service container built with @wroud/di, allowing you to gain deeper insights into your application's dependency graph.

Features

  • Data Collection: Collect detailed information about the service container in a serializable JSON format.
  • Visualization: Utilize D3.js to visualize the collected data, making it easier to understand the relationships and dependencies between services.
  • Integration: Seamlessly integrate with @wroud/di, providing an easy-to-use interface for analyzing and visualizing your service container.

Installation

You can install @wroud/di-tools-analyzer using npm, yarn, pnpm, or bun:

npm

npm install @wroud/di-tools-analyzer

Install via yarn

yarn add @wroud/di-tools-analyzer

Usage

import { ServiceContainerBuilder } from "@wroud/di";
import { getDependenciesGraph, createChart } from "@wroud/di-tools-analyzer";

const builder = new ServiceContainerBuilder();
// Register your services

// Collect dependencies graph
const data = await getDependenciesGraph(builder);

// Serialize the data if needed
const jsonData = JSON.stringify(data);

// Visualize
const svg = document.createElement("svg");
const width = 512;
const height = 512;
const chart = createChart(svg, width, height); // Initialize D3.js
chart.update(graph); // Render graph

Documentation

For detailed usage and API reference, visit the documentation site.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Package Sidebar

Install

npm i @wroud/di-tools-analyzer

Weekly Downloads

20

Version

0.5.1

License

MIT

Unpacked Size

84.9 kB

Total Files

67

Last publish

Collaborators

  • wroud