Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/executing-npm-path
A path of the currently executed npm CLI
https://github.com/shinnn/executing-npm-path
cli environment javascript nodejs npm path
Last synced: 27 days ago
JSON representation
A path of the currently executed npm CLI
- Host: GitHub
- URL: https://github.com/shinnn/executing-npm-path
- Owner: shinnn
- License: isc
- Created: 2018-06-12T05:54:17.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-05T13:18:02.000Z (over 5 years ago)
- Last Synced: 2024-10-05T16:10:46.909Z (about 1 month ago)
- Topics: cli, environment, javascript, nodejs, npm, path
- Language: JavaScript
- Size: 54.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# executing-npm-path
[![npm version](https://img.shields.io/npm/v/executing-npm-path.svg)](https://www.npmjs.com/package/executing-npm-path)
[![Build Status](https://travis-ci.com/shinnn/executing-npm-path.svg?branch=master)](https://travis-ci.com/shinnn/executing-npm-path)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/executing-npm-path.svg)](https://coveralls.io/github/shinnn/executing-npm-path?branch=master)A path of the currently executed [npm CLI](https://github.com/npm/npm)
```javascript
require('executing-npm-path'); //=> /usr/local/lib/node_modules/npm/bin/npm-cli.js
```## Installation
[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/getting-started/what-is-npm).
```
npm install executing-npm-path
```## API
```javascript
const executingNpmPath = require('executing-npm-path');
```### executingNpmPath
Type: `string` or `null`
If the program is executed by an [npm script](https://docs.npmjs.com/misc/scripts), it exposes a path of [`npm-cli.js`](https://github.com/npm/npm/blob/v6.1.0/bin/npm-cli.js), an entry point of npm CLI.
If the program is not executed by any package managers or executed by a non-npm package manager, for example [Yarn](https://github.com/yarnpkg/yarn), it exposes `null`.
## License
[ISC License](./LICENSE) © 2018 Shinnosuke Watanabe