Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

yarn-global

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yarn-global - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

10

index.js

@@ -27,3 +27,3 @@ 'use strict'

function hasDependency(name) {
function getDependencies() {
try {

@@ -33,8 +33,11 @@ const dir = getDirectory()

.keys(require(path.join(dir, '../', 'package.json')).dependencies)
.indexOf(name) !== -1
} catch (_) {
return false
return []
}
}
function hasDependency(name) {
return getDependencies().indexOf(name) !== -1
}
function hasPackage(name) {

@@ -61,3 +64,4 @@ try {

module.exports.inDirectory = inDirectory
module.exports.getDependencies = getDependencies
module.exports.hasDependency = hasDependency
module.exports.hasPackage = hasPackage
{
"name": "yarn-global",
"version": "1.0.2",
"version": "1.1.0",
"description": "A set of useful methods for @yarnpkg",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -17,3 +17,3 @@ # yarn-global

yarnGlobal.getDirectory()
//=> /User/name/.config/yarn/global/node_modules
//=> /Users/name/.config/yarn/global/node_modules

@@ -23,2 +23,5 @@ yarnGlobal.inDirectory(process.cwd())

yarnGlobal.getDependencies()
// An array of denpendencies installed by `yarn global add`
yarnGlobal.hasDependency('create-react-app')

@@ -29,3 +32,3 @@ // Check if you have installed it via `yarn global add`

yarnGlobal.hasPackage('minimist')
// Check if `/User/name/.config/yarn/global/node_modules/minimist` exists
// Check if `/Users/name/.config/yarn/global/node_modules/minimist` exists
// you may not have installed it by `yarn global add`

@@ -32,0 +35,0 @@ //=> true

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc