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

@istanbuljs/load-nyc-config

Package Overview
Dependencies
Maintainers
4
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@istanbuljs/load-nyc-config

Utility function to load nyc configuration

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created

What is @istanbuljs/load-nyc-config?

The @istanbuljs/load-nyc-config package is designed to load the configuration for nyc, a popular code coverage tool used in JavaScript projects. It helps in parsing and assembling the configuration from various sources such as package.json, .nycrc, .nycrc.json, and nyc.config.js files. This package simplifies the process of managing and utilizing nyc configurations, making it easier to integrate code coverage into your testing workflow.

What are @istanbuljs/load-nyc-config's main functionalities?

Loading configuration from a file

This feature allows you to load the nyc configuration asynchronously from the default or specified configuration files within a project directory. It searches for configuration in common file formats and merges them according to precedence.

const loadNycConfig = require('@istanbuljs/load-nyc-config');

async function getConfig() {
  const config = await loadNycConfig({cwd: '/path/to/project'});
  console.log(config);
}

getConfig();

Merging custom options with file-based configuration

This demonstrates how to merge custom configuration options with those loaded from configuration files. It's useful for programmatically adjusting the nyc configuration in scripts or tools.

const loadNycConfig = require('@istanbuljs/load-nyc-config');

async function getConfigWithOverrides() {
  const options = {reporter: ['lcov', 'text']};
  const config = await loadNycConfig({cwd: '/path/to/project'}, options);
  console.log(config);
}

getConfigWithOverrides();

Other packages similar to @istanbuljs/load-nyc-config

FAQs

Package last updated on 20 May 2020

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