Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 16, 2024 via pnpm

cross-env 7.0.3

Run scripts that set and use environment variables across platforms
Package summary
Share
0
issues
2
licenses
5
MIT
2
ISC
Package created
1 Oct 2015
Version published
1 Dec 2020
Maintainers
1
Total deps
7
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
5 Packages, Including:
cross-env@7.0.3
cross-spawn@7.0.3
path-key@3.1.1
shebang-command@2.0.0
shebang-regex@3.0.0

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
isexe@2.0.0
which@2.0.2
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of cross-env 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
cross-spawn7.0.37.3 kBMIT
prod

Visualizations

Frequently Asked Questions

What does cross-env do?

Cross-env is a popular npm package designed to allow you to use UNIX style environment variables on any platform, including Windows, without worrying about platform compatibility. It provides a command for setting environment variables across different platforms seamlessly. This makes it easier to run scripts that need to set and use environment variables across platforms like Windows, macOS, and Linux.

How do you use cross-env?

To use cross-env, it needs to be installed first as one of your project's development dependencies with the following command:

npm install --save-dev cross-env

Once installed, you can use the cross-env command in your npm or yarn scripts. Here is an example:

{
  "scripts": {
    "build": "cross-env NODE_ENV=production webpack --config build/webpack.config.js"
  }
}

In this example, the NODE_ENV environment variable is set to production by cross-env before executing the webpack command. It's also possible to set multiple environment variables at once:

{
  "scripts": {
    "build": "cross-env FIRST_ENV=one SECOND_ENV=two node ./my-program"
  }
}

Another helpful feature of cross-env is running commands with environment variables via cross-env-shell. This is useful when you want the environment variable to be set across an entire inline shell script, rather than just one command.

{
  "scripts": {
    "greet": "cross-env-shell GREETING=Hi NAME=Joe \"echo $GREETING && echo $NAME\""
  }
}

Where are the cross-env docs?

All documentation related to cross-env can be found on its Github page: https://github.com/kentcdodds/cross-env. Here, you can find more detailed usage instructions, examples, as well as information about differences between cross-env and cross-env-shell. Not to mention, details about its installation, other solutions and contributors can also be found in the repository.