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

browser-line-reader

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browser-line-reader - npm Package Compare versions

Comparing version 0.1.2 to 0.2.0

src/interfaces.js

2

package.json
{
"name": "browser-line-reader",
"version": "0.1.2",
"version": "0.2.0",
"description": "A line by line async file reader for the browser",

@@ -5,0 +5,0 @@ "main": "./src/index.js",

@@ -57,3 +57,2 @@ # browser-line-reader

- Support for different file encodings
- Support for different kinds of line separators

@@ -60,0 +59,0 @@ - Support for separate read header action

@@ -5,4 +5,6 @@ // Type definitions for browser-line-reader 0.02

import { Options } from './interfaces';
declare class LineReader {
constructor(file: File);
constructor(file: File, options: Options);

@@ -9,0 +11,0 @@ private static readonly chunkSize: number;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var LineReader = (function () {
function LineReader(file) {
function LineReader(file, options) {
var _this = this;
if (options === void 0) { options = { encoding: 'UTF-8' }; }
this.fileReader = new FileReader();

@@ -12,2 +13,3 @@ this.readPosition = 0;

this.events = new Map();
this.options = options;
this.fileReader.onerror = function () { return _this.emit('error', _this.fileReader.error.message); };

@@ -54,3 +56,3 @@ this.fileReader.onload = function () { return _this.onLoad(); };

this.readPosition += LineReader.chunkSize;
this.fileReader.readAsText(blob);
this.fileReader.readAsText(blob, this.options.encoding);
};

@@ -57,0 +59,0 @@ LineReader.prototype.step = function () {

Sorry, the diff of this file is not supported yet

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