New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@bbc/cloudflare-queue-consumer

Package Overview
Dependencies
Maintainers
8
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bbc/cloudflare-queue-consumer

Build CloudFlare Queue applications without the boilerplate

  • 0.0.3
  • Source
  • npm
  • Socket score

Version published
Maintainers
8
Created
Source

cloudflare-queue-consumer

NPM downloads Build Status Maintainability Test Coverage

Build CloudFlare Queues applications without the boilerplate. Just define an async function that handles the message processing.

Based on sqs-consumer.

Note: This package is still in development and should be used with caution.

Installation

To install this package, simply enter the following command into your terminal (or the variant of whatever package manager you are using):

npm install @bbc/cloudflare-queue-consumer

Documentation

Visit https://bbc.github.io/cloudflare-queue-consumer/ for the full API documentation.

Usage

import { Consumer } from "cloudflare-queue-consumer";

const consumer = new Consumer({
  accountId: process.env.ACCOUNT_ID, // Your CloudFlare account ID
  queueId: process.env.QUEUE_ID, // The Queue ID that you want to use.
  handleMessage: async (message) => {
    // Your message handling code...
  },
});

consumer.start();

TODO: Add more information

Credentials

In order to authenticate with the CloudFlare API, you will need to create an API token with read and write access to CloudFlare Queues, more information can be found here.

Copy that token and set it as the value for an environment variable named QUEUES_API_TOKEN.

Example project

You'll aldo find an example project in the folder ./example, set the variables ACCOUNT_ID and QUEUE_ID and then run this with the command pnpm dev.

Contributing

We welcome and appreciate contributions for anyone who would like to take the time to fix a bug or implement a new feature.

But before you get started, please read the contributing guidelines and code of conduct.

License

CloudFlare Queue Consumer is distributed under the Apache License, Version 2.0, see LICENSE for more information.

Keywords

FAQs

Package last updated on 29 Mar 2024

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc