🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@percy/config

Package Overview
Dependencies
Maintainers
1
Versions
371
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@percy/config

Handles loading and adding options to Percy configuration files. Uses [cosmiconfig](https://github.com/davidtheclark/cosmiconfig) to load configuration files and [JSON schema](https://json-schema.org/) with [AJV](https://github.com/epoberezkin/ajv) to val

beta
Source
npmnpm
Version
1.32.3-beta.3
Version published
Maintainers
1
Created
Source

@percy/config

Handles loading and adding options to Percy configuration files. Uses cosmiconfig to load configuration files and JSON schema with AJV to validate those configuration files.

Loading config files

The .load() method will load and validate a configuration file, optionally merging it with any provided overrides. If no path is provided, will search for the first supported config found from the current directory up to the home directory. Configuration files are cached and reused unless reload is true.

import PercyConfig from '@percy/config'

// loading is done synchronously
const config = PercyConfig.load(options)

Options

  • path — Config file path or directory containing a config file
  • overrides — Config option overrides
  • reload — Do not use cached config (default false)
  • bail — Return undefined when failing validation (default false)
  • print — Print info and error logs (default false)

Supported files

  • "percy" entry in package.json
  • .percyrc YAML or JSON file
  • .percy.json JSON file
  • .percy.yaml or .percy.yml YAML file
  • .percy.js or percy.config.js file that exports an object

Extending config options

The .addSchema() function will add a sub-schema to the Percy configuration file which will be parsed and validated when PercyConfig.load() is called. See JSON schema for possible schema options.

import PercyConfig from '@percy/config'

PercyConfig.addSchema({
  propertyName: JSONSchema
})

FAQs

Package last updated on 29 Jun 2026

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