# @contentpass/pubsub

> Cloud Pub/Sub Client Library for Node.js

Latest version **0.28.2** (published 2019-03-14) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @contentpass/pubsub
pnpm add @contentpass/pubsub
yarn add @contentpass/pubsub
bun add @contentpass/pubsub
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.28.2 |
| Published | 2019-03-14 |
| First published | 2017-09-17 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6.0.0 |
| Dependencies | 18 |
| Unpacked size | 1.3 MB |
| Known vulnerabilities | 0 (+11 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 549 |
| Author | Google Inc. |
| Maintainers | ctavan, datenpate |
| Keywords | google apis client, google api client, google apis, google api, google, google cloud platform, google cloud, cloud, google pubsub, pubsub |

## Links

- npm: https://www.npmjs.com/package/@contentpass/pubsub
- Repository: https://github.com/googleapis/nodejs-pubsub
- Homepage: https://github.com/googleapis/nodejs-pubsub#readme
- Issues: https://github.com/googleapis/nodejs-pubsub/issues
- npm.io page: https://npm.io/package/@contentpass/pubsub

## Dependencies (18)

- [arrify](https://npm.io/package/arrify.md) ^1.0.0
- [extend](https://npm.io/package/extend.md) ^3.0.1
- [p-defer](https://npm.io/package/p-defer.md) ^1.0.0
- [async-each](https://npm.io/package/async-each.md) ^1.0.1
- [google-gax](https://npm.io/package/google-gax.md) ^0.25.0
- [protobufjs](https://npm.io/package/protobufjs.md) ^6.8.1
- [@types/long](https://npm.io/package/@types/long.md) ^4.0.0
- [lodash.merge](https://npm.io/package/lodash.merge.md) ^4.6.0
- [@types/p-defer](https://npm.io/package/@types/p-defer.md) ^1.0.3
- [is-stream-ended](https://npm.io/package/is-stream-ended.md) ^0.1.4
- [@sindresorhus/is](https://npm.io/package/@sindresorhus/is.md) ^0.15.0
- [@types/duplexify](https://npm.io/package/@types/duplexify.md) ^3.6.0
- [lodash.snakecase](https://npm.io/package/lodash.snakecase.md) ^4.1.1
- [google-auth-library](https://npm.io/package/google-auth-library.md) ^3.0.0
- [@google-cloud/paginator](https://npm.io/package/@google-cloud/paginator.md) ^0.2.0
- [@google-cloud/promisify](https://npm.io/package/@google-cloud/promisify.md) ^0.4.0
- [@google-cloud/projectify](https://npm.io/package/@google-cloud/projectify.md) ^0.3.0
- [@google-cloud/precise-date](https://npm.io/package/@google-cloud/precise-date.md) ^0.1.0

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 0.28.2 (latest) — 2019-03-14
- 0.28.1 — 2019-03-13
- 0.16.4-beta.2 — 2018-02-16
- 0.16.4-beta.1 — 2018-02-16
- 0.16.3-beta.5 — 2018-02-16
- 0.16.3-beta.4 — 2018-02-13
- 0.16.3-beta.3 — 2018-02-13
- 0.16.3-beta.2 — 2018-02-13
- 0.16.3-beta.1 — 2018-02-12
- 0.16.3-alpha.9 — 2018-02-12
- 0.16.3-alpha.8 — 2018-02-12
- 0.16.3-alpha.7 — 2018-02-12
- 0.16.3-alpha.6 — 2018-02-12
- 0.16.3-alpha.5 — 2018-02-12
- 0.16.3-alpha.4 — 2018-02-12
- … 5 more at https://npm.io/package/@contentpass/pubsub/versions

## README

[//]: # "This README.md file is auto-generated, all changes to this file will be lost."
[//]: # "To regenerate it, use `npm run generate-scaffolding`."
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>

# [Google Cloud Pub/Sub: Node.js Client](https://github.com/googleapis/nodejs-pubsub)

[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style&#x3D;flat)](https://cloud.google.com/terms/launch-stages)
[![npm version](https://img.shields.io/npm/v/@google-cloud/pubsub.svg)](https://www.npmjs.org/package/@google-cloud/pubsub)
[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-pubsub/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-pubsub)

[Cloud Pub/Sub](https://cloud.google.com/pubsub/docs) is a fully-managed real-time messaging service that allows you to send and receive messages between independent applications.


* [Using the client library](#using-the-client-library)
* [Samples](#samples)
* [Versioning](#versioning)
* [Contributing](#contributing)
* [License](#license)

## Using the client library

1.  [Select or create a Cloud Platform project][projects].

1.  [Enable billing for your project][billing].

1.  [Enable the Google Cloud Pub/Sub API][enable_api].

1.  [Set up authentication with a service account][auth] so you can access the
    API from your local workstation.

1. Install the client library:

        npm install --save @google-cloud/pubsub

1. Try an example:

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

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

  // Creates the new topic
  const [topic] = await pubsub.createTopic(topicName);
  console.log(`Topic ${topic.name} created.`);
}
```

## Samples

Samples are in the [`samples/`](https://github.com/googleapis/nodejs-pubsub/tree/master/samples) directory. The samples' `README.md`
has instructions for running the samples.

| Sample                      | Source Code                       | Try it |
| --------------------------- | --------------------------------- | ------ |
| Subscriptions | [source code](https://github.com/googleapis/nodejs-pubsub/blob/master/samples/subscriptions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/subscriptions.js,samples/README.md) |
| Topics | [source code](https://github.com/googleapis/nodejs-pubsub/blob/master/samples/topics.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-pubsub&page=editor&open_in_editor=samples/topics.js,samples/README.md) |

The [Cloud Pub/Sub Node.js Client API Reference][client-docs] documentation
also contains samples.

## Versioning

This library follows [Semantic Versioning](http://semver.org/).

This library is considered to be in **beta**. This means it is expected to be
mostly stable while we work toward a general availability release; however,
complete stability is not guaranteed. We will address issues and requests
against beta libraries with a high priority.

More Information: [Google Cloud Platform Launch Stages][launch_stages]

[launch_stages]: https://cloud.google.com/terms/launch-stages

## Contributing

Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-pubsub/blob/master/CONTRIBUTING.md).

## License

Apache Version 2.0

See [LICENSE](https://github.com/googleapis/nodejs-pubsub/blob/master/LICENSE)

## What's Next

* [Cloud Pub/Sub Documentation][product-docs]
* [Cloud Pub/Sub Node.js Client API Reference][client-docs]
* [github.com/googleapis/nodejs-pubsub](https://github.com/googleapis/nodejs-pubsub)

Read more about the client libraries for Cloud APIs, including the older
Google APIs Client Libraries, in [Client Libraries Explained][explained].

[explained]: https://cloud.google.com/apis/docs/client-libraries-explained

[client-docs]: https://cloud.google.com/nodejs/docs/reference/pubsub/latest
[product-docs]: https://cloud.google.com/pubsub/docs
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
[projects]: https://console.cloud.google.com/project
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=pubsub.googleapis.com
[auth]: https://cloud.google.com/docs/authentication/getting-started

---
_Source: https://npm.io/package/@contentpass/pubsub · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
