-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing non working example with publish #471
Conversation
Publish 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>`
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
Thanks for the PR - but I think #464 already addresses these changes, so I'm closing this for now. Feel free to comment/reopen if that's not the case. |
Yeah! That's the stuff lol we even used the same variable names 🤣 thanks @ace-n! |
🤖 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).
🤖 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).
🤖 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).
Publish 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:
Use it like
node publisher.js <mydata>