Socket
Socket
Sign inDemoInstall

@istanbuljs/esm-loader-hook

Package Overview
Dependencies
5
Maintainers
4
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @istanbuljs/esm-loader-hook

Loader hook for ESM instrumentation (experimental!!)


Version published
Weekly downloads
2.6K
decreased by-7.85%
Maintainers
4
Created
Weekly downloads
 

Readme

Source

@istanbuljs/esm-loader-hook

Tests NPM Version NPM Downloads ISC

This loader hook makes it relatively easy to use NYC to check coverage of ESM running in node.js 13.7.0. Note this makes use of experimental node.js features and thus may stop working upon release of new versions of node.js. Until the node.js feature is stabilized breakage should not be unexpected.

For more stable options to test coverage you can:

  • Use c8
  • Pre-instrument your code (run nyc instrument then test the output)

Adding to processes

To install this hook into a process the module must be provided through the --experimental-loader flag.

The following can be used for your npm test script to enable live instrumentation of ES modules being tested with mocha:

cross-env 'NODE_OPTIONS=--experimental-loader @istanbuljs/esm-loader-hook' nyc mocha

Configuration

This module executes babel-plugin-istanbul in a transformSource loader hook. No options are provided to the babel plugin and babel configuration files are not honored. Normally configuration will be provided by the currently running instance of nyc. If this module is run outside nyc then it will use @istanbuljs/load-nyc-config to load options, defaults from @istanbuljs/schema will apply to missing options or if no configuration is found.

@istanbuljs/esm-loader-hook for enterprise

Available as part of the Tidelift Subscription.

The maintainers of @istanbuljs/esm-loader-hook and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.

FAQs

Last updated on 17 Mar 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc