Socket
Socket
Sign inDemoInstall

gitlab-fetcher

Package Overview
Dependencies
5
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitlab-fetcher

Simple helper to aggregate Gitlab API results across multiple pages


Version published
Maintainers
1
0
Install size
54.5 kB

Weekly downloads

Readme

Source

gitlab-fetcher

Simple helper to aggregate Gitlab API results across multiple pages

Usage

Fetching a paginated collection

import { fetchGitlab } from "gitlab-fetcher";

fetchGitlab("YourToken", "https://gitlab.url/projects/1/issues", { scope: "all", state: "opened" })
  .then(issues => {
    /* ... */
  })
  .catch(console.error);

issues will contain a Promise resolving to aggregated results from all result pages. An Error will be thrown in case of HTTP error (with message containing response.statusText).

Other requests (single entity, POST, etc.)

import { callGitlab } from "gitlab-fetcher";

callGitlab("YourToken", "https://gitlab.url/projects/1/issues", { /* ... */ }, "post")
  .then(response => response.json())
  .catch(console.error);

Server-side

This package can be easily used with Node.js and ESM:

/* eslint-env node */
global.fetch = require("node-fetch");
global.Headers = require("fetch-headers");

const { callGitlab, fetchGitlab } = require("gitlab-fetcher");

Simply run your script with node -r esm path/to/script.js.

FAQs

Last updated on 13 May 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