
Security News
NVD Quietly Sweeps 100K+ CVEs Into a “Deferred” Black Hole
NVD now marks all pre-2018 CVEs as "Deferred," signaling it will no longer enrich older vulnerabilities, further eroding trust in its data.
global-prefix
Advanced tools
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.
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);
Similar to global-prefix, global-modules provides the location of the global npm modules directory. However, it focuses specifically on the modules directory rather than the npm prefix.
This package is similar to global-prefix but offers more detailed information, including paths to npm's directories for packages, binaries, and data. It provides a broader scope of information about global directories.
While not directly related to global paths, which-pm-runs can be used to detect which package manager is currently running a script, which can be useful in conjunction with global path information to perform package manager-specific operations.
Get the npm global path prefix.
Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your :heart: and support.
Install with npm:
$ npm install --save global-prefix
This is partially based on the code used by npm internally to resolve the global prefix.
var prefix = require('global-prefix');
//=> '/usr/local' (this path will differ by system and user-defined config)
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
You might also be interested in these projects:
Commits | Contributor |
---|---|
23 | jonschlinkert |
15 | doowb |
2 | phated |
1 | rmbaad |
1 | avengerpenguin |
1 | jorrit |
1 | mathiasvr |
1 | tunnckoCore |
Jon Schlinkert
Copyright © 2018, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.6.0, on October 11, 2018.
FAQs
Get the npm global path prefix.
The npm package global-prefix receives a total of 15,850,199 weekly downloads. As such, global-prefix popularity was classified as popular.
We found that global-prefix demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
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.
Security News
NVD now marks all pre-2018 CVEs as "Deferred," signaling it will no longer enrich older vulnerabilities, further eroding trust in its data.
Research
Security News
Lazarus-linked threat actors expand their npm malware campaign with new RAT loaders, hex obfuscation, and over 5,600 downloads across 11 packages.
Security News
Safari 18.4 adds support for Iterator Helpers and two other TC39 JavaScript features, bringing full cross-browser coverage to key parts of the ECMAScript spec.