You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

global-prefix

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

global-prefix

Get the npm global path prefix.


Version published
Weekly downloads
16M
increased by1.16%
Maintainers
1
Install size
10.9 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

Install with npm:

$ npm install 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. | homepage
  • global-paths: Returns an array of unique "global" directories based on the user's platform and environment. The… more | homepage

Running tests

Install dev dependencies:

$ npm install -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 © 2016 Jon Schlinkert Copyright (c) npm, Inc. and Contributors Released under the MIT license.


This file was generated by verb, v0.9.0, on March 13, 2016.

Keywords

FAQs

Package last updated on 13 Mar 2016

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc