
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
@utilify/environment
Advanced tools
A utility library for detecting the runtime environment (Node.js, browser, Deno, etc.) and various environment-specific properties.
The Environment category contains utility functions that help detect and identify the environment in which the code is running, whether it's in the browser, server, or within different types of workers. These functions are useful for providing environment-specific behaviors.
To install the environment utilities, use one of the following commands, depending on your package manager:
npm install @utilify/environment
yarn add @utilify/environment
pnpm add @utilify/environment
Once installed, you can import the functions into your project, using either ESM or CJS.
This library supports both ESM and CJS module systems.
import { isBrowser } from '@utilify/environment';
const { isBrowser } = require('@utilify/environment');
Here’s an overview of the functions available in the environment category:
function getOS(): string | undefined;
Returns the user's operating system based on the browser's userAgent. Returns undefined if executed in the server.
function isBun(): boolean;
Checks if the code is running in the Bun environment by identifying the execution type through the Bun object.
function isBrowser(): boolean;
Checks if the code is running in a browser environment by checking the type of window.
function isDeno(): boolean;
Checks if the code is running in the Deno environment by verifying the presence of the Deno object.
function isDedicatedWorker(): boolean;
Determines if the code is running inside a Dedicated Worker by checking the type of self.
function isMobile(): boolean | undefined;
Checks if the code is running on a mobile device based on the browser's userAgent.
function isNode(): boolean;
Determines if the code is running in a Node.js environment by checking the presence of global and process objects.
function isServer(): boolean;
Detects if the code is running on the server by checking if the environment is Node.js, Deno, or Bun.
function isServiceWorker(): boolean;
Checks if the code is running inside a Service Worker by using the type of self.
function isSharedWorker(): boolean;
Determines if the code is running inside a Shared Worker by checking the type of self.
function isWebWorker(): boolean;
Checks if the code is running inside any type of Web Worker, including Dedicated, Shared, or Service Worker.
FAQs
A utility library for detecting the runtime environment (Node.js, browser, Deno, etc.) and various environment-specific properties.
We found that @utilify/environment demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.