@nbn23/cloud-tasks
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

NBN23 CloudTasks

CloudTasks is a wrapper over a cloud task library to avoid vendor lock and provide an utility to schedule HTTP requests as tasks. The current version works over @google-cloud/tasks library in Google Cloud Platorm.

Getting Started

Install CloudTasks using npm.

npm install --save @nbn23/cloud-tasks

Note: CloudTasks assumes a TypeScript environment

Usage

import { CloudTasks } from "@nbn23/cloud-tasks";

const projectId = "string";
const location = "españa-west-1";
const cloudTasks = await CloudTasks.newInstance({ projectId, location });

const task = {
  url: "https://fake.com",
  method: Method.POST,
  headers: { "Content-Type": "application/json" },
  body: { foo: "bar" }
};
const queue = "name-queue";
await cloudTasks.schedule(queue, task);

Readme

Keywords

Package Sidebar

Install

npm i @nbn23/cloud-tasks

Weekly Downloads

186

Version

1.3.1

License

ISC

Unpacked Size

24.2 kB

Total Files

12

Last publish

Collaborators

  • nbn
  • maraat