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

vega-loader

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vega-loader

Network request and file loading utilities.

  • 4.5.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
64K
decreased by-55.31%
Maintainers
1
Weekly downloads
 
Created

What is vega-loader?

The vega-loader npm package is a utility for loading data in Vega visualizations. It provides a flexible and extensible way to fetch data from various sources, including URLs, files, and inline data. This package is essential for handling data input in Vega specifications, enabling users to integrate diverse data sources seamlessly.

What are vega-loader's main functionalities?

Loading Data from URLs

This feature allows users to load data from a specified URL. The loader fetches the data and returns it as a promise, which can then be processed as needed.

const vega = require('vega-loader');
const loader = vega.loader();
loader.load('https://api.example.com/data.json').then(data => {
  console.log(JSON.parse(data));
});

Loading Inline Data

This feature allows users to load inline data directly. The loader can handle different data formats such as JSON, CSV, and TSV, making it versatile for various data input scenarios.

const vega = require('vega-loader');
const loader = vega.loader();
const inlineData = '[{"name": "Alice", "age": 30}, {"name": "Bob", "age": 25}]';
loader.load({type: 'json', value: inlineData}).then(data => {
  console.log(data);
});

Customizing Loaders

This feature allows users to customize the loader with options such as base URL and headers. This is useful for scenarios where data fetching requires authentication or specific configurations.

const vega = require('vega-loader');
const customLoader = vega.loader({
  baseURL: 'https://api.example.com/',
  headers: { 'Authorization': 'Bearer token' }
});
customLoader.load('data.json').then(data => {
  console.log(JSON.parse(data));
});

Other packages similar to vega-loader

Keywords

FAQs

Package last updated on 11 Mar 2022

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