Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More

@forge/events

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@forge/events

Forge Async Event methods

  • 0.8.5-next.0
  • npm
  • Socket score

Version published
Weekly downloads
1.1K
decreased by-4.51%
Maintainers
2
Weekly downloads
 
Created

Library for asynchronous data processing.

Usage example:

import fetch, { RequestInit } from 'node-fetch';

import { Queue } from './index';

const API_BASE = 'https://api.atlassian.com';

// For Async service auth
const appContextAri = 'ari:cloud:jira::site/...';
const token = '...';

async function apiClient(path: string, init: RequestInit): Promise<APIResponse> {
  const url = API_BASE + path;

  const extraHeaders = {
    // See add-forge-user-agent.ts
    'X-Forge-Context': appContextAri,

    Authorization: `Bearer ${token}`
  };

  init.headers = Object.assign(init.headers!, extraHeaders);
  return fetch(url, init);
}

async function demo() {
  const queue = new Queue({key: "queue-name"}, apiClient);
  const payloads = {
    page: 1
  }
  await queue.push([payloads])
}

demo();

FAQs

Package last updated on 06 Apr 2023

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