You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

glob-stream

Package Overview
Dependencies
Maintainers
2
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glob-stream

Readable streamx interface over anymatch.

8.0.3
latest
Source
npmnpm
Version published
Weekly downloads
3.4M
3.64%
Maintainers
2
Weekly downloads
 
Created

What is glob-stream?

The glob-stream npm package allows for reading file paths from a globbing pattern. It is a wrapper around node-glob and vinyl-fs to stream the file objects that match the glob patterns. This package is particularly useful in build processes and file manipulation scripts where matching files based on patterns is required.

What are glob-stream's main functionalities?

Reading files using glob patterns

This feature allows you to read files that match a specific pattern. In the code sample, all JavaScript files under the 'src' directory and its subdirectories are matched and their paths are logged.

const globStream = require('glob-stream');

const stream = globStream('./src/**/*.js');
stream.on('data', function(file) {
  console.log(file.path);
});

Combining multiple glob patterns

glob-stream supports combining multiple patterns, including exclusion patterns. In this example, all JavaScript files under 'src' except those in the 'vendor' subdirectory are matched.

const globStream = require('glob-stream');

const stream = globStream(['./src/**/*.js', '!./src/vendor/**']);
stream.on('data', function(file) {
  console.log(file.path);
});

Other packages similar to glob-stream

Keywords

glob

FAQs

Package last updated on 01 Jun 2025

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