gce-output-stream
Get a stream of output from a Google Compute Engine instance
$ npm install --save gce-output-stream
var outputStream = require('gce-output-stream')
outputStream({
zone: 'us-central1-a',
name: 'app-http-server'
})
.on('data', function (line) {
})
Authorization
This module uses google-auto-auth to get the required access token. If you don't meet the requirements for automatic authentication, you will need to provide the same configuration object detailed in that readme.
outputStream({
authConfig: {
keyFile: 'key.json'
}
})
API
outputStream = require('gce-output-stream')
stream = outputStream(config)
An output stream with the results of iterative calls to getSerialPortOutput
. Each data event emitted is a single line.
config.name
The name of your instance.
config.zone
The name of the zone the instance is running in. (Ex: us-central1-a
)
config.authClient
If you want to re-use an auth client from google-auto-auth, pass an instance here.
config.authConfig
See authConfig
.
config.port
- Type:
Number
- Optional
- Default:
1
config.projectId
The projectId your instance is hosted under.
The COM or serial port to retrieve data from. Acceptable values are 1
-4
.