Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11M
decreased by-26.13%
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

FAQs

Package last updated on 11 Dec 2012

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

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