Socket
Socket
Sign inDemoInstall

get-installed-path

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-installed-path

Get installation path where the given package is installed. Works for globally and locally installed packages


Version published
Weekly downloads
107K
decreased by-21.75%
Maintainers
1
Weekly downloads
 
Created

What is get-installed-path?

The get-installed-path npm package is used to find the path where an npm package is installed. This can be useful for various tasks such as debugging, custom module loading, or verifying installations.

What are get-installed-path's main functionalities?

Get the installed path of a package

This feature allows you to get the installed path of a specified npm package. In this example, it retrieves the path for the 'express' package.

const getInstalledPath = require('get-installed-path');

getInstalledPath('express').then((path) => {
  console.log(path);
}).catch((err) => {
  console.error(err);
});

Get the installed path of a package with options

This feature allows you to get the installed path of a specified npm package with additional options. In this example, the 'local' option is set to true to find the package in the local node_modules directory.

const getInstalledPath = require('get-installed-path');

getInstalledPath('express', { local: true }).then((path) => {
  console.log(path);
}).catch((err) => {
  console.error(err);
});

Get the installed path of a package synchronously

This feature allows you to get the installed path of a specified npm package synchronously. In this example, it retrieves the path for the 'express' package synchronously.

const getInstalledPath = require('get-installed-path');

try {
  const path = getInstalledPath.sync('express');
  console.log(path);
} catch (err) {
  console.error(err);
}

Other packages similar to get-installed-path

Keywords

FAQs

Package last updated on 12 Oct 2017

Did you know?

Socket

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.

Install

Related posts

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