🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

streamsearch

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

streamsearch

Streaming Boyer-Moore-Horspool searching for node.js

1.1.0
latest
Source
npm
Version published
Weekly downloads
20M
8.3%
Maintainers
1
Weekly downloads
 
Created

What is streamsearch?

The streamsearch npm package is primarily used for searching for a specific sequence of bytes in a streaming data source. It is particularly useful for parsing streams to find delimiters or separators, such as in multipart/form-data streams where boundaries need to be identified. This package provides a fast and efficient way to scan through data without buffering the entire stream, making it ideal for handling large volumes of data in real-time.

What are streamsearch's main functionalities?

Byte sequence searching in streams

This feature allows the user to search for a specific byte sequence within a stream. The example code initializes a StreamSearch instance with a needle ('example') and pushes a buffer to it. It listens for 'info' events to detect matches and outputs whether the needle was found in the provided data.

const StreamSearch = require('streamsearch');

let needle = Buffer.from('example');
let s = new StreamSearch(needle);

s.on('info', (isMatch, data, start, end) => {
  console.log('Data:', data);
  console.log('Match found:', isMatch);
});

// Simulate streaming data
s.push(Buffer.from('some example data containing the needle'));

Other packages similar to streamsearch

Keywords

stream

FAQs

Package last updated on 19 Dec 2021

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