GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||
GeezerVison is showing github.com — Fixing non working example with publish by khaosdoctor · Pull Request #471 · GoogleCloudPlatform/nodejs-docs-samples ConversationPublish example was not working, so I updated it to the new API (because I needed to read the source code to understand this part), so it's easier for us to use the docs. Here's my code as an example:
const PubSub = require('@google-cloud/pubsub') const chalk = require('chalk') function run () { console.log(chalk.bold.cyan('Publishing Message...')) return PubSub().topic('my-topic').publisher().publish(new Buffer.from(process.argv.pop())) .then((results) => { console.log(`Message ${chalk.bold.green(results.shift())} published`) return results }) .catch(console.error) } run() Use it like
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsPublish example was not working, so I updated it to the new API (because I needed to read the source code to understand this part), so it's easier for us to use the docs.
Here's my code as an example:
> publisher.js
```js
const PubSub = require('@google-cloud/pubsub')
const chalk = require('chalk')
function run () {
console.log(chalk.bold.cyan('Publishing Message...'))
return PubSub().topic('my-topic').publisher().publish(new Buffer.from(process.argv.pop()))
.then((results) => {
console.log(`Message ${chalk.bold.green(results.shift())} published`)
return results
})
.catch(console.error)
}
run()
```
Use it like `node publisher.js <mydata>`
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
NimJay
pushed a commit
that referenced
this pull request
🤖 I have created a release \*beep\* \*boop\* --- ### [2.4.2](https://www.github.com/googleapis/nodejs-kms/compare/v2.4.1...v2.4.2) (2021-06-29) ### Bug Fixes * **deps:** google-gax v2.17.0 with mTLS ([#471](https://www.github.com/googleapis/nodejs-kms/issues/471)) ([9841f22](https://www.github.com/googleapis/nodejs-kms/commit/9841f227e64da2ee6158b6c43a0339c2b1fa8e3a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
ace-n
pushed a commit
that referenced
this pull request
🤖 I have created a release \*beep\* \*boop\* --- ### [2.4.2](https://www.github.com/googleapis/nodejs-kms/compare/v2.4.1...v2.4.2) (2021-06-29) ### Bug Fixes * **deps:** google-gax v2.17.0 with mTLS ([#471](https://www.github.com/googleapis/nodejs-kms/issues/471)) ([9841f22](https://www.github.com/googleapis/nodejs-kms/commit/9841f227e64da2ee6158b6c43a0339c2b1fa8e3a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
unforced
pushed a commit
that referenced
this pull request
🤖 I have created a release *beep* *boop* --- ## [5.10.0](googleapis/nodejs-security-center@v5.9.0...v5.10.0) (2022-04-11) ### Features * Add iam_binding field to findings attributes. It represents particular IAM bindings, which captures a member's role addition, removal, or state ([#474](googleapis/nodejs-security-center#474)) ([b29893c](googleapis/nodejs-security-center@b29893c)) * Add next_steps field to finding's list of attributes ([#476](googleapis/nodejs-security-center#476)) ([326e8d2](googleapis/nodejs-security-center@326e8d2)) * AuditConfig for IAM v1 ([#470](googleapis/nodejs-security-center#470)) ([2ec070f](googleapis/nodejs-security-center@2ec070f)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | |||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |