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
-
Select or create a Cloud Platform project.
-
Enable billing for your project.
-
Enable the Google Cloud Tasks API.
-
Set up authentication with a service account so you can access the
API from your local workstation.
-
Install the client library:
npm install --save @google-cloud/tasks
-
Try an example:
const {CloudTasksClient} = require('@google-cloud/tasks');
async function quickstart(
projectId = 'your-project-id',
queue = 'my-appengine-queue',
location = 'us-central-1'
) {
const client = new CloudTasksClient();
const [response] = await client.createQueue({
parent: client.locationPath(projectId, location),
queue: {
name: client.queuePath(projectId, location, queue),
appEngineHttpQueue: {
appEngineRoutingOverride: {
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.
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