Socket
Book a DemoInstallSign in
Socket

@kanaries/web-data-loader

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kanaries/web-data-loader

data loader tools for common datasource types (in browser)

latest
Source
npmnpm
Version
0.1.7
Version published
Maintainers
1
Created
Source

web-data-loader

data loader for data analytic product in working in browser

web-data-loader allows you to load larget data files in browser. It supports stream data and runs in webworker which will not block the main thread while loading the data. web-data-loader also support stream data sampling, it now support Reservoir Sampling methods.

Usage

Install

npm i --save @kanaries/web-data-loader

Examples

in your project file:

get user upload file

<input type="file" id="#file" />

use web-data-loader to load the data with sampling.

(document.querySelector("#file") as HTMLInputElement).onchange = (
  ev: Event
) => {
  const file = (ev.target as HTMLInputElement).files[0];
  FileReader.csvReader(
    file,
    {
      type: "reservoirSampling",
      size: 400
    },
    value => {
      console.log((value * 100).toFixed(2) + '%');
    }
  ).then(data => console.log(data));
  // FileReader.csvReader(file).then(data => console.log(data));
};

Docs

documents can be found at API Reference

Keywords

data-loader

FAQs

Package last updated on 04 Jul 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