npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

crds-cypress-config

v1.0.2

Published

Cypress methods to apply configurations and environment variables

Readme

Cypress config tools

This package contains plugins for loading environment variables into Cypress

Tools provided include:

Install with

npm install crds-cypress-config --save-dev

loadConfigFromVault

This plugin adds variables to config.env from the Crossroads Vault when Cypress loads.

Environment Variables

This plugin requires the following environment variables to be set in the command line environment before Cypress is run. Since the plugin runs as part of the Cypress environment setup, passing them as config or config.env parameters when Cypress starts will not work.

VAULT_ROLE_ID
VAULT_SECRET_ID

Setup

  1. Create this JSON file cypress/config/vault_config.json and configure a list of sources for secrets and keys you want loaded. Note that this variables are non-sensitive and can be stored in github.
{
  "sources": [
    {
      "secret": "crds-net",
      "keys": ["SECRET_1"]
    },
    {
      "secret": "crds-secret-vault-2",
      "keys": ["SECRET_3", "SECRET_4"]
    }
  ]
}
  1. Require this package in cypress/plugins/index.js and pass the config value into loadConfigFromVault.
//cypress/plugins/index.js
const loadConfig = require('crds-cypress-config');

module.exports = (on, config) => {
  return loadConfig.loadConfigFromVault(config);
};
  1. Set the environment variable "vaultEnv" to the vault's environment when Cypress starts.
npx cypress open --env vaultEnv=int

To confirm your file was loaded correctly when using cypress open, check the environment variables under Settings => Configuration.

Defaults

If "vaultEnv" is undefined at startup, the plugin will attempt to load secrets from the int Vault.

loadConfigFromFile

(Obsolete) This plugin adds variables from a JSON config file when Cypress loads.

Cypress 4.1.0 added similar functionality. If possible, use Cypress's --configFile flag instead.

Setup

  1. Create a JSON file in cypress/config/ and add your configurations. Check out Cypress's configuration documents for things that can be configured.

  2. Require this package in cypress/plugins/index.js and pass the config value into loadConfigFromFile.

//cypress/plugins/index.js
const loadConfig = require('crds-cypress-config');

module.exports = (on, config) => {
  return loadConfig.loadConfigFromFile(config);
};
  1. Set the environment variable configFile to the name of the config file (without the path or extension) when Cypress starts.
npx cypress open --env configFile=my_config

To confirm your file was loaded correctly when using cypress open, check the environment variables under Settings => Configuration.

Defaults

If "configFile" is undefined at startup, the plugin will attempt to load the cypress/config/int_crossroads.json file.

Load variables from file and Vault

loadConfigFromVault can be run after loadConfigFromFile, allowing you to set vaultEnv in a sharable config file.

//cypress/config/int_crossroads.json
{
  "baseUrl": "https://int.crossroads.net",
  "env": {
    "CRDS_ENV": "int",
    "vaultEnv": "int"
  }
}
//cypress/config/vault_config.json
{
  "sources": [
    {
      "secret": "crds-net",
      "keys": ["SECRET_1"]
    }
  ]
}
//cypress/plugins/index.js
const loadConfig = require('crds-cypress-config');

module.exports = (on, config) => {
  return loadConfig.loadConfigFromFile(config).then(loadConfig.loadConfigFromVault);
};

To run on bash:

export VAULT_ROLE_ID="..."
export VAULT_SECRET_ID="..."
npx cypress open --env configFile=int_crossroads

or on Powershell

$env:VAULT_ROLE_ID = "..."
$env:VAULT_SECRET_ID = "..."
npx cypress open --env configFile=int_crossroads

readConfigFile

This plugin helper reads a file from cypress/config/ and returns a promise with its contents in object form. It must be given the file's name without extension. It will only read JSON files in cypress/config/ and will return a rejected promise if the file is not found.

//cypress/plugins/index.js
const loadConfig = require('crds-cypress-config');

module.exports = (on, config) => {
  return loadConfig.readConfigFile(config.configFile).then(response => {
    config.env["CRDS_ENV"] = response.env["CRDS_ENV"];
    return config;
  });
};