Check which JavaScript environment your code is running in at runtime: browser, Node.js, Bun, etc
MIT License
Bot releases are hidden (Show)
Published by sindresorhus 5 months ago
https://github.com/sindresorhus/environment/compare/v1.0.0...v1.1.0
Published by sindresorhus 6 months ago
🦄
Check if a string matches the name of a Node.js builtin module
Check if the process is running inside Windows Subsystem for Linux (Bash on Windows)
Run the Node.js binary no matter what
Check if the process is running inside a Docker container
Type check values
Check if your code is running as an npm or yarn script
Check if the internet connection is up
Check if the process is running in a Continuous Integration (CI) environment
Check whether a binary version satisfies a semver range
Check if the operating system CPU architecture is 64-bit or 32-bit (Supports browsers)
Get the operating system CPU architecture
Check if stdout or stderr is interactive
Check if Electron is running in development
Check whether a file can be executed
Check if the process is running as root user, for example, one started with `sudo`