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

@statoscope/cli

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@statoscope/cli

Statoscope CLI tools

  • 5.8.0-alpha.0
  • alpha
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9.4K
increased by67.92%
Maintainers
1
Weekly downloads
 
Created
Source

Statoscope CLI

npm version Support

This package supplies Statoscope as CLI tool

Installation

npm i @statoscope/cli -g

Usage

statoscope [command] [...args]

Commands

validate

Validate or compare webpack stats.

validate [...args]

  • --input (-i) - path to a stats.json
  • --reference (-r) - path to a stats-file to compare with (optional)
  • --config (-c) - path to statoscope config (by default {pwd}/statoscope.config.js has used)
  • --warn-as-error (-w) - treat warnings as errors

This command uses stats-validator. Please look at this package for more info

Example:

  1. Create a statosope-config:

statoscope.config.js

module.exports = {
  validate: {
    // add webpack plugin with rules
    plugins: ['@statoscope/webpack'],
    reporters: [
      // console-reporter to output results into cinsole (enabled by default)
      '@statoscope/console',
      // reporter that henerates UI-report with validation-results
      ['@statosope/stats-report', {open: true}],
    ],
    rules: {
      // ensures that build-time of your bundle hasn't exceeded 10 sec
      '@statoscope/webpack/build-time-limits': ['error', {global: 10000}],
      // any other rules
    }
  }
}
  1. Exec the command:
statoscope validate --input path/to/stats.json
  1. Analyze results in the console or in generated UI-report

serve

Start HTTP-server and serve JSON-stats as HTML report

serve input [...args]

  • --input (-i) - path to one or more webpack stats
  • --host (-h) - server host
  • --port (-p) - server port
  • --open (-o) - open browser after server start

Example:

statoscope serve path/to/stats.json -o

Start server and open browser.

generate

Generate HTML report from JSON-stats.

generate input output [...args]

  • --input (-i) - path to one or more webpack stats
  • --output (-t) - path to generated HTML
  • --open (-o) - open browser after generate

Example:

statoscope generate path/to/stats.json path/to/report.html -o

Create statoscope report, save it to path/to/report.html and open

Support

If you are an engineer or a company that is interested in Statoscope improvements, you may support Statoscope by financial contribution at OpenCollective.

FAQs

Package last updated on 15 Sep 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