Socket
Socket
Sign inDemoInstall

@istanbuljs/schema

Package Overview
Dependencies
0
Maintainers
4
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@istanbuljs/schema

Schemas describing various structures used by nyc and istanbuljs


Version published
Maintainers
4
Weekly downloads
24,011,800
increased by1.14%
Install size
17.7 kB

Weekly downloads

Package description

What is @istanbuljs/schema?

The @istanbuljs/schema package provides JSON schemas for the configuration options of various IstanbulJS libraries. These schemas are used to validate and document the expected format and types of configuration objects. This can be particularly useful for developers integrating IstanbulJS tools into their projects, ensuring they configure the tools correctly according to the schema definitions.

What are @istanbuljs/schema's main functionalities?

Validation of nyc configuration

This code sample demonstrates how to use the @istanbuljs/schema package to validate an nyc configuration object. It uses the Ajv library to compile and validate the configuration against the schema.

const Ajv = require('ajv');
const ajv = new Ajv();
const nycConfigSchema = require('@istanbuljs/schema').nycConfig;
const validate = ajv.compile(nycConfigSchema);
const valid = validate({
  'check-coverage': true,
  'per-file': true,
  lines: 90,
  functions: 90,
  branches: 90,
  statements: 90
});
if (!valid) console.log(validate.errors);

Other packages similar to @istanbuljs/schema

Readme

Source

@istanbuljs/schema

Travis CI NPM Version NPM Downloads MIT

Schemas describing various structures used by nyc and istanbuljs

Usage

const {nyc} = require('@istanbuljs/schema').defaults;

console.log(`Default exclude list:\n\t* ${nyc.exclude.join('\n\t* ')}`);

@istanbuljs/schema for enterprise

Available as part of the Tidelift Subscription.

The maintainers of @istanbuljs/schema 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 13 Feb 2021

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