Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@loaders.gl/core
Advanced tools
@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.
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');
PapaParse is a powerful CSV parser that can handle large files and various edge cases. It is specifically designed for parsing CSV data, whereas @loaders.gl/core provides a more general framework for loading and parsing multiple data formats.
Axios is a popular HTTP client for making requests to fetch data from URLs. While it focuses on making HTTP requests, @loaders.gl/core provides a higher-level abstraction for loading and parsing data from various sources.
d3-dsv is a module from the D3.js library that provides functions for parsing and formatting delimiter-separated values (DSV) files. It is specialized for DSV formats, whereas @loaders.gl/core supports a wider range of data formats and provides a unified API.
This module contains shared utilities for loaders.gl, a collection of framework-independent 3D and geospatial loaders (parsers).
For documentation please visit the website.
v3.0.0-alpha.12
FAQs
The core API for working with loaders.gl loaders and writers
The npm package @loaders.gl/core receives a total of 183,371 weekly downloads. As such, @loaders.gl/core popularity was classified as popular.
We found that @loaders.gl/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.