Socket
Socket
Sign inDemoInstall

@loaders.gl/core

Package Overview
Dependencies
1
Maintainers
9
Versions
324
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loaders.gl/core


Version published
Maintainers
9
Created

Package description

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

Readme

Source

@loaders.gl/core

This module contains shared utilities for loaders.gl, a collection of framework independent 3D and geospatial loaders (parsers).

For documentation please visit the website.

Keywords

FAQs

Last updated on 28 Jun 2019

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc