### Installing std-env Library Source: https://github.com/unjs/std-env/blob/main/README.md This snippet provides commands for installing the `std-env` library using popular JavaScript package managers: npm, pnpm, and yarn. Choose the command corresponding to your preferred package manager to add `std-env` to your project dependencies. ```sh # Using npm npm i std-env # Using pnpm pnpm i std-env # Using yarn yarn add std-env ``` -------------------------------- ### Importing std-env in JavaScript Source: https://github.com/unjs/std-env/blob/main/README.md This snippet demonstrates how to import the `std-env` library in both ECMAScript Modules (ESM) and CommonJS formats. It shows how to destructure common exports like `env`, `isDevelopment`, and `isProduction` for direct use in your application. ```js // ESM import { env, isDevelopment, isProduction } from "std-env"; // CommonJS const { env, isDevelopment, isProduction } = require("std-env"); ``` -------------------------------- ### Accessing Process Object with std-env Source: https://github.com/unjs/std-env/blob/main/README.md This snippet demonstrates importing the `process` proxy from `std-env`. This proxy offers a platform-agnostic interface to the `process` object, similar to Node.js's global `process`, enabling consistent access to process-related information across different runtimes. ```ts import { process } from "std-env"; ``` -------------------------------- ### Detecting CI Provider with std-env in TypeScript Source: https://github.com/unjs/std-env/blob/main/README.md This TypeScript snippet illustrates how to use `std-env` to detect the current CI/CD provider. It logs `isCI` (a boolean indicating if running in a CI environment), `provider` (the detected provider name), and `providerInfo` (a detailed object about the provider). ```ts import { isCI, provider, providerInfo } from "std-env"; console.log({ isCI, // true provider, // "github_actions" providerInfo // { name: "github_actions", isCI: true } }); ``` -------------------------------- ### Detecting JavaScript Runtime with std-env in TypeScript Source: https://github.com/unjs/std-env/blob/main/README.md This TypeScript snippet demonstrates how `std-env` can detect the current JavaScript runtime. It logs the `runtime` string (e.g., 'node', 'deno', 'bun') and `runtimeInfo` object, providing details about the detected runtime based on WinterCG Runtime Keys proposal. ```ts import { runtime, runtimeInfo } from "std-env"; // "" | "node" | "deno" | "bun" | "workerd" ... console.log(runtime); // { name: "node" } console.log(runtimeInfo); ``` -------------------------------- ### Accessing Environment Variables with std-env Source: https://github.com/unjs/std-env/blob/main/README.md This snippet shows how to import the `env` proxy from `std-env`. The `env` object provides a platform-agnostic way to access environment variables, abstracting away differences between various JavaScript runtimes and environments. ```ts import { env } from "std-env"; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.