Socket
Socket
Sign inDemoInstall

fileset

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fileset

Wrapper around miniglob / minimatch combo to allow multiple patterns matching and include-exclude ability


Version published
Weekly downloads
481K
decreased by-18.65%
Maintainers
1
Weekly downloads
 
Created

What is fileset?

The fileset npm package allows you to find files in a directory that match a given set of glob patterns. It is useful for tasks such as file manipulation, batch processing, and automation scripts.

What are fileset's main functionalities?

Basic File Matching

This feature allows you to find all JavaScript files in a directory, excluding those in the node_modules directory. The code sample demonstrates how to use the fileset function to match files based on glob patterns.

const fileset = require('fileset');

fileset('**/*.js', 'node_modules/**', function(err, files) {
  if (err) return console.error(err);
  console.log(files);
});

Multiple Patterns

This feature allows you to match files based on multiple patterns. The code sample shows how to find all JavaScript and CSS files in a directory, excluding those in the node_modules directory.

const fileset = require('fileset');

fileset(['**/*.js', '**/*.css'], 'node_modules/**', function(err, files) {
  if (err) return console.error(err);
  console.log(files);
});

Excluding Patterns

This feature allows you to exclude files based on patterns. The code sample demonstrates how to find all files in a directory, excluding those in the node_modules and dist directories.

const fileset = require('fileset');

fileset('**/*', ['node_modules/**', 'dist/**'], function(err, files) {
  if (err) return console.error(err);
  console.log(files);
});

Other packages similar to fileset

FAQs

Package last updated on 14 Jun 2015

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