New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@statoscope/stats-extension-custom-reports

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@statoscope/stats-extension-custom-reports

Statoscope extension to store custom reports in stats

  • 5.19.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
126K
increased by22.5%
Maintainers
1
Weekly downloads
 
Created

What is @statoscope/stats-extension-custom-reports?

@statoscope/stats-extension-custom-reports is an npm package designed to extend the capabilities of Statoscope by allowing users to create custom reports based on Webpack stats. This package is useful for developers who need to generate specific insights and metrics from their Webpack build statistics.

What are @statoscope/stats-extension-custom-reports's main functionalities?

Custom Report Creation

This feature allows users to create custom reports by defining a report name and a function that processes Webpack stats to generate the desired data. The example code creates a report that includes the total number of modules and the total size of assets.

const { createReport } = require('@statoscope/stats-extension-custom-reports');

const report = createReport({
  name: 'My Custom Report',
  data: (stats) => {
    return {
      totalModules: stats.modules.length,
      totalSize: stats.assets.reduce((sum, asset) => sum + asset.size, 0)
    };
  }
});

console.log(report);

Integration with Statoscope

This feature demonstrates how to integrate custom reports into Statoscope. The example code shows how to add a custom report to Statoscope and generate a report that includes the custom data.

const { addExtension } = require('@statoscope/stats-extension-custom-reports');
const statoscope = require('statoscope');

addExtension(statoscope, {
  reports: [
    {
      name: 'My Custom Report',
      data: (stats) => {
        return {
          totalModules: stats.modules.length,
          totalSize: stats.assets.reduce((sum, asset) => sum + asset.size, 0)
        };
      }
    }
  ]
});

statoscope.generateReport();

Other packages similar to @statoscope/stats-extension-custom-reports

FAQs

Package last updated on 25 Nov 2021

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