Big update!Announcing Socket for GitHub 1.0. Learn more
Socket
BlogLoveFAQ
Install
Log in

@istanbuljs/load-nyc-config

Package Overview
Dependencies
5
Maintainers
4
Versions
5
Issues
File Explorer

Advanced tools

@istanbuljs/load-nyc-config

Utility function to load nyc configuration

    1.1.0latest

Version published
Maintainers
4
Weekly downloads
15,350,666
decreased by-3.35%

Weekly downloads

Changelog

Source

1.1.0 (2020-05-20)

Features

  • Create isLoading function (#15) (0e58b51)
  • Support loading ES module config from .js files (#14) (b1ea369)

Readme

Source

@istanbuljs/load-nyc-config

The utility function which NYC uses to load configuration. This can be used by outside programs to calculate the configuration. Command-line arguments are not considered by this function.

const {loadNycConfig} = require('@istanbuljs/load-nyc-config'); (async () { console.log(await loadNycConfig()); })();

loadNycConfig([options])

options.cwd

Type: string Default: cwd from parent nyc process or process.cwd()

options.nycrcPath

Type: string Default: undefined

Name of the file containing nyc configuration. This can be a relative or absolute path. Relative paths can exist at options.cwd or any parent directory. If an nycrc is specified but cannot be found an exception is thrown.

If no nycrc option is provided the default priority of config files are:

  • .nycrc
  • .nycrc.json
  • .nycrc.yml
  • .nycrc.yaml
  • nyc.config.js
  • nyc.config.cjs
  • nyc.config.mjs

Configuration merging

Configuration is first loaded from package.json if found, this serves as the package defaults. These options can be overridden by an nycrc if found. Arrays are not merged, so if package.json sets "require": ["@babel/register"] and .nycrc sets "require": ["esm"] the effective require setting will only include "esm".

isLoading

const {isLoading} = require('@istanbuljs/load-nyc-config'); console.log(isLoading());

In some cases source transformation hooks can get installed before the configuration is loaded. This allows hooks to ignore source loads that occur during configuration load.

@istanbuljs/load-nyc-config for enterprise

Available as part of the Tidelift Subscription.

The maintainers of @istanbuljs/load-nyc-config 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

What is @istanbuljs/load-nyc-config?

Utility function to load nyc configuration

Is @istanbuljs/load-nyc-config popular?

The npm package @istanbuljs/load-nyc-config receives a total of 12,269,891 weekly downloads. As such, @istanbuljs/load-nyc-config popularity was classified as popular.

Is @istanbuljs/load-nyc-config well maintained?

We found that @istanbuljs/load-nyc-config demonstrated a not healthy version release cadence and project activity. It has 4 open source maintainers collaborating on the project.

Last updated on 20 May 2020
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc