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

fstream-ignore

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fstream-ignore

A thing for ignoring files based on globs

  • 0.0.10
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
261K
decreased by-14.21%
Maintainers
1
Weekly downloads
 
Created

What is fstream-ignore?

The fstream-ignore npm package is a specialized file stream filter that allows you to include or exclude files based on .gitignore-style rules. It is particularly useful for creating tarballs, zips, or other file archives where you need to exclude certain files or directories.

What are fstream-ignore's main functionalities?

Filtering files based on .gitignore rules

This feature allows you to filter files in a directory based on rules specified in .gitignore files. The code sample demonstrates how to create an Ignore stream that reads from a directory and applies the ignore rules.

const Ignore = require('fstream-ignore');
const ignore = new Ignore({ path: 'path/to/dir', ignoreFiles: ['.gitignore'] });
ignore.on('child', function (c) {
  console.error(c.path);
});
ignore.on('end', function () {
  console.error('done');
});

Custom ignore rules

This feature allows you to specify custom ignore rules directly in the code, without relying on an external .gitignore file. The code sample shows how to create an Ignore stream with custom rules to exclude .log files and the node_modules directory.

const Ignore = require('fstream-ignore');
const ignore = new Ignore({ path: 'path/to/dir', ignoreRules: ['*.log', 'node_modules/'] });
ignore.on('child', function (c) {
  console.error(c.path);
});
ignore.on('end', function () {
  console.error('done');
});

Other packages similar to fstream-ignore

FAQs

Package last updated on 11 Jul 2014

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