Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 15, 2024 via pnpm

npm-run-path 4.0.1

Get your PATH prepended with locally installed binaries
Package summary
Share
0
issues
1
license
2
MIT
Package created
28 Dec 2015
Version published
22 Dec 2019
Maintainers
1
Total deps
2
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
npm-run-path@4.0.1
path-key@3.1.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of npm-run-path 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
path-key3.1.12.21 kBMIT
prod

Visualizations

Frequently Asked Questions

What does npm-run-path do?

The npm-run-path is a useful npm package, designed to prepend your PATH with locally installed binaries. In npm run scripts, you can execute locally installed binaries by name. The npm-run-path package facilitates this functionality outside of npm. This increases flexibility and ease of use in script execution, making it an essential tool for many JavaScript developers.

How do you use npm-run-path?

You can use npm-run-path in your JavaScript project by first installing the package with npm using the command npm install npm-run-path. Once installed, you can import the functions from the package into your JavaScript file. The package provides two primary functions: npmRunPath() and npmRunPathEnv().

The npmRunPath() function returns an augmented PATH string that includes the paths to locally installed binaries. The npmRunPathEnv() function returns an augmented process.env object, which includes the modified PATH.

Here is a simple usage example:

import childProcess from 'node:child_process';
import {npmRunPath, npmRunPathEnv} from 'npm-run-path';

console.log(process.env.PATH);
//=> '/usr/local/bin'

console.log(npmRunPath());
// Output includes paths to local binaries

// `foo` is a locally installed binary
childProcess.execFileSync('foo', {
	env: npmRunPathEnv()
});

This script uses childProcess.execFileSync to run a locally installed binary named 'foo', prepending the PATH with binary locations using npmRunPathEnv().

Where are the npm-run-path docs?

The primary source of documentation for the npm-run-path package is its README file, found in its repository on GitHub at git+https://github.com/sindresorhus/npm-run-path.git. The README provides a comprehensive guide on how to install and use the package, along with detailed information about the API and available options for customizing the package's behavior. Also, more insights can be gathered from the source code and from the npm-run-path-cli, a related package that provides a command-line interface for npm-run-path.