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

babel-plugin-istanbul

Package Overview
Dependencies
Maintainers
0
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-istanbul

A babel plugin that adds istanbul instrumentation to ES6 code

  • 7.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25M
decreased by-4.03%
Maintainers
0
Weekly downloads
 
Created

What is babel-plugin-istanbul?

The babel-plugin-istanbul npm package is used to instrument your JavaScript code with Istanbul coverage. It works seamlessly with Babel and test runners like Mocha, Jest, and others to generate coverage reports. This plugin is typically used during testing to collect information about which parts of your codebase are covered by tests.

What are babel-plugin-istanbul's main functionalities?

Code Instrumentation

This feature automatically instruments your code with Istanbul coverage when it is being transpiled by Babel. The code sample shows how to apply the plugin when transforming code with Babel.

require('babel-core').transform('code', { plugins: ['istanbul'] });

Coverage Reporting

After running tests with the instrumented code, you can generate coverage reports in various formats using Istanbul's command line tool, nyc. The code sample shows how to generate a text report.

nyc report --reporter=text

Configuration Options

The plugin allows you to specify options such as excluding files or directories from being instrumented. The code sample demonstrates how to exclude all files in the 'test' directory.

{ 'plugins': [['istanbul', { 'exclude': ['test/**/*.js'] }]] }

Other packages similar to babel-plugin-istanbul

Keywords

FAQs

Package last updated on 05 Jul 2024

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