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

@istanbuljs/nyc-config-hook-run-in-this-context

Package Overview
Dependencies
Maintainers
5
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@istanbuljs/nyc-config-hook-run-in-this-context

nyc configuration for hook-run-in-this-context

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2K
increased by17.31%
Maintainers
5
Weekly downloads
 
Created
Source

nyc-config-hook-run-in-this-context

Handy configuration for instrumenting with hook-run-in-this-context enabled.

Prior to node.js 11.11.0 require() was implemented using vm.runInThisContext(). This meant that running with hook-run-in-this-context enabled required disabling hook-require. Starting with node 11.11.0 require() is no longer implemented with vm.runInThisContext(), so hook-require still needs to be enabled. This base configuration enables hook-run-in-this-context and provides the correct setting for hook-require to ensure that modules loaded by require() are instrumented once.

First install the dependencies:

npm i nyc @istanbuljs/nyc-config-hook-run-in-this-context --save-dev

.nycrc

And write a .nycrc that looks like this:

{
    "extends": "@istanbuljs/nyc-config-hook-run-in-this-context"
    /* add custom settings */
}

License

ISC

Keywords

FAQs

Package last updated on 25 Jul 2023

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