https://github.com/odedniv/node-gcloud-cli
Download gcloud CLI if it doesn't exist in PATH.
https://github.com/odedniv/node-gcloud-cli
Last synced: 5 months ago
JSON representation
Download gcloud CLI if it doesn't exist in PATH.
- Host: GitHub
- URL: https://github.com/odedniv/node-gcloud-cli
- Owner: odedniv
- Created: 2019-05-27T14:20:00.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-27T14:22:09.000Z (about 7 years ago)
- Last Synced: 2025-10-22T04:57:07.429Z (8 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gcloud-cli
Download gcloud CLI if it doesn't exist in PATH.
## Usage
Install with:
```bash
npm install --save gcloud-cli
```
Then use it:
```javascript
const GcloudCli = require('gcloud-cli');
// returns a promise that resolves to an absolute path of a gcloud executable
GcloudCli.getPath();
// or add some options
new GcloudCli({
// where to extract the tar, defaults to OS' temporary directory (e.g '/tmp')
extractPath: os.tmpdir(),
// which version to download (if a download is needed), defaults to the one specified in index.js
downloadVersion: '...',
}).getPath();
```