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

resolve-global

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

resolve-global - npm Package Compare versions

Comparing version 0.1.0 to 1.0.0

index.d.ts

12

index.js

@@ -5,6 +5,6 @@ 'use strict';

module.exports = moduleId => {
const resolveGlobal = moduleId => {
try {
return require.resolve(path.join(globalDirs.yarn.packages, moduleId));
} catch (err) {
} catch (_) {
return require.resolve(path.join(globalDirs.npm.packages, moduleId));

@@ -14,8 +14,10 @@ }

module.exports = resolveGlobal;
module.exports.silent = moduleId => {
try {
return module.exports(moduleId);
} catch (err) {
return null;
return resolveGlobal(moduleId);
} catch (_) {
return undefined;
}
};
{
"name": "resolve-global",
"version": "0.1.0",
"description": "Resolve the path of a globally installed module",
"license": "MIT",
"repository": "sindresorhus/resolve-global",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"resolve",
"global",
"package",
"module",
"globally",
"path",
"npm",
"yarn",
"packages",
"require"
],
"dependencies": {
"global-dirs": "^0.1.0"
},
"devDependencies": {
"ava": "*",
"execa": "^0.7.0",
"xo": "*"
}
"name": "resolve-global",
"version": "1.0.0",
"description": "Resolve the path of a globally installed module",
"license": "MIT",
"repository": "sindresorhus/resolve-global",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"resolve",
"global",
"package",
"module",
"globally",
"path",
"npm",
"yarn",
"packages",
"require"
],
"dependencies": {
"global-dirs": "^0.1.1"
},
"devDependencies": {
"ava": "^1.4.1",
"execa": "^1.0.0",
"tsd": "^0.7.2",
"xo": "^0.24.0"
}
}

@@ -35,3 +35,3 @@ # resolve-global [![Build Status](https://travis-ci.org/sindresorhus/resolve-global.svg?branch=master)](https://travis-ci.org/sindresorhus/resolve-global)

Returns `null` instead of throwing if the module can't be found.
Returns `undefined` instead of throwing if the module can't be found.

@@ -38,0 +38,0 @@ #### moduleId

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