New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@qvac/dl-base

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qvac/dl-base

Base dataloader class for QVAC

latest
Source
npmnpm
Version
0.2.1
Version published
Maintainers
3
Created
Source

@qvac/dl-base

This is the base class for QVAC dataloader libraries. It aims to provide a common interface for loading data from various sources.

Installation

npm i @qvac/dl-base

Usage

Extend the base class and implement the following methods:

  • _open(): Initialize the dataloader / client
  • _close(): Clean up the dataloader / client
  • getStream(path): Return a readable stream for the given path
  • list(path): Return a list of files in the given path

NOTE: To open/close the resource, call ready() or close(). They extend functionality from ready-resource to handle single resource management

A sample HTTP dataloader implementation is shown below:

const Base = require('@qvac/dl-base')
const axios = require('axios')

class HTTPDL extends Base {
  async _open () {
    this.client = axios.create({
      baseURL: this.opts.url
    })
  }

  async _close () {
    this.client = null
  }

  async list (path) {
    const resp = await this.client.get(path)
    return resp.data
  }

  async getStream (path) {
    const resp = await this.client.get(path, { responseType: 'stream' })
    return resp.data
  }
}

module.exports = HTTPDL

Keywords

tether

FAQs

Package last updated on 31 Mar 2026

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