Socket
Socket
Sign inDemoInstall

@google-cloud/tasks

Package Overview
Dependencies
178
Maintainers
5
Versions
62
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @google-cloud/tasks

Cloud Tasks API client for Node.js


Version published
Weekly downloads
325K
decreased by-0.09%
Maintainers
5
Created
Weekly downloads
 

Readme

Source

Google Cloud Platform logo

Google Cloud Tasks: Node.js Client

release level npm version codecov

Node.js idiomatic client for Cloud Tasks.

Manages the execution of large numbers of distributed requests.

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

Table of contents:

Using the client library

  1. Select or create a Cloud Platform project.

  2. Enable billing for your project.

  3. Enable the Google Cloud Tasks API.

  4. Set up authentication with a service account so you can access the API from your local workstation.

  5. Install the client library:

     npm install --save @google-cloud/tasks
    
  6. Try an example:

// Imports the Google Cloud client library
const {CloudTasksClient} = require('@google-cloud/tasks');

async function quickstart(
  projectId = 'your-project-id', // Your Google Cloud Platform project ID
  queue = 'my-appengine-queue', // Name of the Queue to create
  location = 'us-central-1' // The region in which to create the queue
) {
  // Instantiates a client
  const client = new CloudTasksClient();

  // Send create queue request.
  const [response] = await client.createQueue({
    // The fully qualified path to the location where the queue is created
    parent: client.locationPath(projectId, location),
    queue: {
      // The fully qualified path to the queue
      name: client.queuePath(projectId, location, queue),
      appEngineHttpQueue: {
        appEngineRoutingOverride: {
          // The App Engine service that will receive the tasks.
          service: 'default',
        },
      },
    },
  });
  console.log(`Created queue ${response.name}`);
}

Samples

Samples are in the samples/ directory. The samples' README.md has instructions for running the samples.

SampleSource CodeTry it
Queuessource codeOpen in Cloud Shell
Taskssource codeOpen in Cloud Shell

The Cloud Tasks Node.js Client API Reference documentation also contains samples.

Versioning

This library follows Semantic Versioning.

This library is considered to be in alpha. This means it is still a work-in-progress and under active development. Any release is subject to backwards-incompatible changes at any time.

More Information: Google Cloud Platform Launch Stages

Contributing

Contributions welcome! See the Contributing Guide.

License

Apache Version 2.0

See LICENSE

Keywords

FAQs

Last updated on 22 Mar 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc