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

fetch-event-stream

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

fetch-event-stream - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

16

esm/mod.js

@@ -39,8 +39,12 @@ import * as utils from './utils.js';

let iter = utils.stream(res.body);
let line, reader = iter.getReader();
let event;
let line;
for await (line of iter) {
if (signal && signal.aborted)
break;
if (!line) {
for (;;) {
if (signal && signal.aborted) {
return reader.cancel();
}
line = await reader.read();
if (line.done)
return;
if (!line.value) {
if (event)

@@ -51,3 +55,3 @@ yield event;

}
let [field, value] = utils.split(line) || [];
let [field, value] = utils.split(line.value) || [];
if (!field)

@@ -54,0 +58,0 @@ continue; // comment or invalid

{
"name": "fetch-event-stream",
"version": "0.1.3",
"description": "A tiny (745b) utility for Server Sent Event (SSE) streaming via `fetch` and Web Streams API",
"version": "0.1.4",
"description": "A tiny (774b) utility for Server Sent Event (SSE) streaming via `fetch` and Web Streams API",
"keywords": [

@@ -6,0 +6,0 @@ "SSE",

<!-- deno-fmt-ignore-file -->
# fetch-event-stream [![CI](https://github.com/lukeed/fetch-event-stream/workflows/CI/badge.svg)](https://github.com/lukeed/fetch-event-stream/actions?query=workflow%3ACI) [![licenses](https://licenses.dev/b/npm/fetch-event-stream)](https://licenses.dev/npm/fetch-event-stream)
> A tiny (745b) utility for Server Sent Event (SSE) streaming via `fetch` and Web Streams API
> A tiny (774b) utility for Server Sent Event (SSE) streaming via `fetch` and Web Streams API

@@ -20,2 +20,4 @@ * Allows any HTTP method

> Available on [JSR](https://jsr.io/@lukeed/fetch-event-stream), [npm](https://www.npmjs.com/package/fetch-event-stream), and [deno.land](https://deno.land/x/fetch_event_stream)
```

@@ -22,0 +24,0 @@ $ npm install --save fetch-event-stream

@@ -65,8 +65,12 @@ "use strict";

let iter = utils.stream(res.body);
let line, reader = iter.getReader();
let event;
let line;
for await (line of iter) {
if (signal && signal.aborted)
break;
if (!line) {
for (;;) {
if (signal && signal.aborted) {
return reader.cancel();
}
line = await reader.read();
if (line.done)
return;
if (!line.value) {
if (event)

@@ -77,3 +81,3 @@ yield event;

}
let [field, value] = utils.split(line) || [];
let [field, value] = utils.split(line.value) || [];
if (!field)

@@ -80,0 +84,0 @@ continue; // comment or invalid

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