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

cypress-expose

v1.1.2

Published

Expose public variables via CYPRESS_EXPOSE process variables

Downloads

617

Readme

cypress-expose

Expose public variables via CYPRESS_EXPOSE process variables

Install

$ npm i -D cypress-expose

Use

Any env variable that starts with CYPRESS_EXPOSE will be cast and normalized

const { defineConfig } = require('cypress')
const cypressExpose = require('cypress-expose')

module.exports = defineConfig({
  allowCypressEnv: false,
  e2e: {
    setupNodeEvents(on, config) {
      cypressExpose(config)

      // IMPORTANT: return the config object
      // to let Cypress know we modified it
      return config
    },
  },
})

Pass any variables that you are OK with being public using the CYPRESS_EXPOSE prefix:

CYPRESS_EXPOSE_foo=42 npx cypress run

The above execution will have Cypress.expose('foo') // 42

This makes is especially convenient to pass config / CI variables that are not exposed by default

# GitHub Actions
- name: Run tests 🧪
  # https://github.com/cypress-io/github-action
  uses: cypress-io/github-action@v7
  env:
    # note: the variables will be normalized to camel case
    CYPRESS_EXPOSE_PUBLIC_VARIABLE_1: foo
    CYPRESS_EXPOSE_PUBLIC_VARIABLE_2: bar
    CYPRESS_EXPOSE_PUBLIC_VARIABLE_3: baz
    # default CI variable
    CYPRESS_EXPOSE_CI: true
    CYPRESS_EXPOSE_CI_NAME: 'GitHub Actions'

The above example will have Cypress.expose() include the following object

Cypress.expose()
// {
//   publicVariable1: 'foo'
//   publicVariable2: 'bar'
//   publicVariable3: 'baz'
//   ci: true
//   ciName: 'GitHub Actions'
// }

The same approach works for keys starting with expose inside the env object

const { defineConfig } = require('cypress')
const cypressExpose = require('cypress-expose')

module.exports = defineConfig({
  allowCypressEnv: false,
  e2e: {
    env: {
      exposeMe: true,
    },

    setupNodeEvents(on, config) {
      cypressExpose(config)

      // IMPORTANT: return the config object
      // to let Cypress know we modified it
      return config
    },
  },
})

There will be no cy.env('me') value, instead you can get it via Cypress.expose('me') // true

Examples