Skip to content

Commit

Permalink
chore(deps): upgrade dependencies for Node.js images
Browse files Browse the repository at this point in the history
Source-Link: googleapis/synthtool@1dd93a3
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:3ad01f4c6671efb094b43f7d3a3e0b9510bd6501f2e65e874dd525373e29de75
  • Loading branch information
gcf-owl-bot[bot] committed Aug 1, 2023
1 parent 6efeb2c commit cd423e8
Show file tree
Hide file tree
Showing 53 changed files with 6,172 additions and 472 deletions.
4 changes: 2 additions & 2 deletions .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest
digest: sha256:ef104a520c849ffde60495342ecf099dfb6256eab0fbd173228f447bc73d1aa9
# created: 2023-07-10T21:36:52.433664553Z
digest: sha256:3ad01f4c6671efb094b43f7d3a3e0b9510bd6501f2e65e874dd525373e29de75
# created: 2023-08-01T22:29:52.50398591Z
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ npm install @google-cloud/pubsub

```javascript
// Imports the Google Cloud client library
const {PubSub} = require('@google-cloud/pubsub');
const { PubSub } = require("@google-cloud/pubsub");

async function quickstart(
projectId = 'your-project-id', // Your Google Cloud Platform project ID
topicNameOrId = 'my-topic', // Name for the new topic to create
subscriptionName = 'my-sub' // Name for the new subscription to create
projectId = 'your-project-id', // Your Google Cloud Platform project ID
topicNameOrId = 'my-topic', // Name for the new topic to create
subscriptionName = 'my-sub' // Name for the new subscription to create
) {
// Instantiates a client
const pubsub = new PubSub({projectId});
const pubsub = new PubSub({ projectId });

// Creates a new topic
const [topic] = await pubsub.createTopic(topicNameOrId);
Expand All @@ -84,19 +84,19 @@ async function quickstart(
const [subscription] = await topic.createSubscription(subscriptionName);

// Receive callbacks for new messages on the subscription
subscription.on('message', message => {
subscription.on('message', (message) => {
console.log('Received message:', message.data.toString());
process.exit(0);
});

// Receive callbacks for errors on the subscription
subscription.on('error', error => {
subscription.on('error', (error) => {
console.error('Received error:', error);
process.exit(1);
});

// Send a message to the topic
topic.publishMessage({data: Buffer.from('Test message!')});
topic.publishMessage({ data: Buffer.from('Test message!') });
}

```
Expand Down
Loading

0 comments on commit cd423e8

Please sign in to comment.