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

@loaders.gl/core

Package Overview
Dependencies
Maintainers
8
Versions
340
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loaders.gl/core

The core API for working with loaders.gl loaders and writers

  • 4.3.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
234K
increased by4.1%
Maintainers
8
Weekly downloads
 
Created

What is @loaders.gl/core?

@loaders.gl/core is a framework-agnostic library for loading and processing data in various formats. It provides a unified API for handling different types of data sources, making it easier to work with complex data pipelines.

What are @loaders.gl/core's main functionalities?

Loading Data

This feature allows you to load data from various sources using different loaders. In this example, the CSVLoader is used to load a CSV file from a URL.

const { load } = require('@loaders.gl/core');
const { CSVLoader } = require('@loaders.gl/csv');

async function loadData(url) {
  const data = await load(url, CSVLoader);
  console.log(data);
}

loadData('https://example.com/data.csv');

Parsing Data

This feature allows you to parse data from a string or buffer using different parsers. In this example, the JSONLoader is used to parse a JSON string.

const { parse } = require('@loaders.gl/core');
const { JSONLoader } = require('@loaders.gl/json');

async function parseData(jsonString) {
  const data = await parse(jsonString, JSONLoader);
  console.log(data);
}

parseData('{"key": "value"}');

Creating Custom Loaders

This feature allows you to create and register custom loaders for handling specific data formats. In this example, a CustomLoader is created and registered to load data from a custom format.

const { registerLoaders, Loader } = require('@loaders.gl/core');

class CustomLoader extends Loader {
  parse(arrayBuffer) {
    // Custom parsing logic
    return { data: new Uint8Array(arrayBuffer) };
  }
}

registerLoaders([new CustomLoader()]);

async function loadCustomData(url) {
  const data = await load(url, CustomLoader);
  console.log(data);
}

loadCustomData('https://example.com/data.custom');

Other packages similar to @loaders.gl/core

Keywords

FAQs

Package last updated on 26 Nov 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