Socket
Socket
Sign inDemoInstall

is-installed-globally

Package Overview
Dependencies
3
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.4.0 to 1.0.0

4

index.d.ts

@@ -6,3 +6,3 @@ /**

```
import isInstalledGlobally = require('is-installed-globally');
import isInstalledGlobally from 'is-installed-globally';

@@ -20,2 +20,2 @@ // With `npm install your-package`

export = isInstalledGlobally;
export default isInstalledGlobally;

@@ -1,11 +0,14 @@

'use strict';
const fs = require('fs');
const globalDirs = require('global-dirs');
const isPathInside = require('is-path-inside');
import fs from 'node:fs';
import path from 'node:path';
import {fileURLToPath} from 'node:url';
import globalDirectory from 'global-directory';
import isPathInside from 'is-path-inside';
module.exports = (() => {
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const isInstalledGlobally = (() => {
try {
return (
isPathInside(__dirname, globalDirs.yarn.packages) ||
isPathInside(__dirname, fs.realpathSync(globalDirs.npm.packages))
isPathInside(__dirname, globalDirectory.yarn.packages)
|| isPathInside(__dirname, fs.realpathSync(globalDirectory.npm.packages))
);

@@ -16,1 +19,3 @@ } catch {

})();
export default isInstalledGlobally;
{
"name": "is-installed-globally",
"version": "0.4.0",
"version": "1.0.0",
"description": "Check if your package was installed globally",

@@ -13,4 +13,10 @@ "license": "MIT",

},
"type": "module",
"exports": {
"types": "./index.d.ts",
"default": "./index.js"
},
"sideEffects": false,
"engines": {
"node": ">=10"
"node": ">=18"
},

@@ -43,14 +49,14 @@ "scripts": {

"dependencies": {
"global-dirs": "^3.0.0",
"is-path-inside": "^3.0.2"
"global-directory": "^4.0.1",
"is-path-inside": "^4.0.0"
},
"devDependencies": {
"ava": "^2.4.0",
"cpy": "^8.1.1",
"del": "^6.0.0",
"execa": "^5.0.0",
"make-dir": "^3.1.0",
"tsd": "^0.14.0",
"xo": "^0.37.1"
"ava": "^5.3.1",
"cpy": "^8",
"del": "^7.1.0",
"execa": "^8.0.1",
"make-dir": "^4.0.0",
"tsd": "^0.29.0",
"xo": "^0.56.0"
}
}

@@ -9,5 +9,5 @@ # is-installed-globally

```sh
npm install is-installed-globally
```
$ npm install is-installed-globally
```

@@ -17,3 +17,3 @@ ## Usage

```js
const isInstalledGlobally = require('is-installed-globally');
import isInstalledGlobally from 'is-installed-globally';

@@ -33,2 +33,2 @@ // With `npm install your-package`

- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module
- [global-dirs](https://github.com/sindresorhus/global-dirs) - Get the directory of globally installed packages and binaries
- [global-directory](https://github.com/sindresorhus/global-directory) - Get the directory of globally installed packages and binaries
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc