What is @statoscope/stats-extension-package-info?
@statoscope/stats-extension-package-info is an npm package designed to extend Statoscope's capabilities by providing detailed information about packages in your project. It helps in analyzing and visualizing package-related data within your webpack stats.
What are @statoscope/stats-extension-package-info's main functionalities?
Package Information Extraction
This feature allows you to extract detailed information about the packages used in your project from the webpack stats. The code sample demonstrates how to use the `getPackageInfo` function to retrieve and log package information.
const { getPackageInfo } = require('@statoscope/stats-extension-package-info');
const stats = require('./path-to-stats.json');
const packageInfo = getPackageInfo(stats);
console.log(packageInfo);
Custom Report Generation
This feature enables you to generate custom reports based on the package information extracted from the webpack stats. The code sample shows how to generate an HTML report using the `generateReport` function.
const { generateReport } = require('@statoscope/stats-extension-package-info');
const stats = require('./path-to-stats.json');
const report = generateReport(stats, { output: 'html' });
console.log(report);
Integration with Statoscope
This feature allows seamless integration with Statoscope, enhancing its functionality by adding package information. The code sample demonstrates how to initialize and apply the Statoscope extension with the package info.
const Statoscope = require('@statoscope/stats-extension-package-info');
const stats = require('./path-to-stats.json');
const statoscope = new Statoscope(stats);
statoscope.apply();
Other packages similar to @statoscope/stats-extension-package-info
webpack-bundle-analyzer
webpack-bundle-analyzer is a powerful tool that provides a visual representation of the size of webpack output files. It helps in analyzing the content of your bundles and understanding which modules contribute to their size. Unlike @statoscope/stats-extension-package-info, it focuses more on visualizing the bundle size rather than providing detailed package information.
source-map-explorer
source-map-explorer analyzes JavaScript bundles using source maps to determine which file each byte in your minified code came from. It provides a detailed breakdown of the bundle contents, similar to @statoscope/stats-extension-package-info, but it focuses on source maps rather than package information.
bundle-stats
bundle-stats is a tool that generates bundle size reports with detailed insights into the content of your webpack bundles. It provides a comprehensive analysis of the bundle size, similar to @statoscope/stats-extension-package-info, but it emphasizes bundle size metrics and trends over time.