Socket
Socket
Sign inDemoInstall

global-prefix

Package Overview
Dependencies
1
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    global-prefix

Get the npm global path prefix.


Version published
Weekly downloads
14M
decreased by-10.32%
Maintainers
1
Install size
10.4 kB
Created
Weekly downloads
 

Package description

What is global-prefix?

The global-prefix npm package provides a way to determine the path of the global npm directory on a system. This can be useful for packages that need to know where global modules are installed, for example, to check if a certain global package is installed or to install a package globally programmatically.

What are global-prefix's main functionalities?

Get global npm prefix

This feature allows you to retrieve the path of the global npm directory. The code sample requires the global-prefix module and then logs the global npm prefix to the console.

const globalPrefix = require('global-prefix');
console.log(globalPrefix);

Other packages similar to global-prefix

Readme

Source

global-prefix NPM version Build Status

Get the npm global path prefix.

Install with npm

$ npm i global-prefix --save

This is the code used by npm internally to resolve the global prefix.

Usage

var prefix = require('global-prefix');
//=> '/usr/local'
  • global-modules: The directory used by npm for globally installed npm modules.
  • global-paths: Returns an array of unique "global" directories based on the user's platform and environment. The… more

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Authors

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Copyright (c) npm, Inc. and Contributors Released under the MIT license.


This file was generated by verb-cli on July 16, 2015.

Keywords

FAQs

Last updated on 16 Jul 2015

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.

Install

Related posts

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