
Product
A Fresh Look for the Socket Dashboard
We’ve redesigned the Socket dashboard with simpler navigation, less visual clutter, and a cleaner UI that highlights what really matters.
is-yarn-global
Advanced tools
The is-yarn-global npm package is a utility that helps you determine if a package was installed globally using Yarn. This can be useful for scripts and tools that need to behave differently based on the installation method.
Check if a package is installed globally with Yarn
This feature allows you to check if the current package was installed globally using Yarn. The code sample demonstrates how to use the is-yarn-global package to log a message based on the installation method.
const isYarnGlobal = require('is-yarn-global');
if (isYarnGlobal()) {
console.log('This package was installed globally with Yarn.');
} else {
console.log('This package was not installed globally with Yarn.');
}
The global-modules package helps you find the path to the global node_modules directory. While it doesn't specifically check if a package was installed globally with Yarn, it can be used to determine the global installation path for both npm and Yarn.
The global-prefix package retrieves the global installation prefix for npm or Yarn. This can be useful for determining where global packages are installed, but it doesn't specifically check if a package was installed globally with Yarn.
Check if installed by yarn globally without any fs
calls
$ npm install is-yarn-global
Just require it in your package.
import isYarnGlobal from 'is-yarn-global';
console.log(isYarnGlobal());
MIT © LitoMore
FAQs
Check if installed by yarn globally without any `fs` calls
The npm package is-yarn-global receives a total of 6,848,407 weekly downloads. As such, is-yarn-global popularity was classified as popular.
We found that is-yarn-global demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Product
We’ve redesigned the Socket dashboard with simpler navigation, less visual clutter, and a cleaner UI that highlights what really matters.
Industry Insights
Terry O’Daniel, Head of Security at Amplitude, shares insights on building high-impact security teams, aligning with engineering, and why AI gives defenders a fighting chance.
Security News
MCP spec updated with structured tool output, stronger OAuth 2.1 security, resource indicators, and protocol cleanups for safer, more reliable AI workflows.