Return a specific value depending on the environment.
npm install env-crosser
const envCrosser = require("env-crosser");
envCrosser({
browser: "Browser!",
worker: "Web Worker!",
node: "NodeJS!",
fallback: "???"
})
//=> "NodeJS!" (When using NodeJS)
Type: object
Type: any
The value to return in a browser.
Type: any
The value to return in a web worker.
Type: any
The value to return in NodeJS.
Type: any
The value to fall back to if all the other checks fail or a corresponding value isn't provided.