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

file-set

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

file-set

Cross-platform glob expansions simplified. Input: file paths and glob expressions. Output: resolved file paths organised by type (file, directory and not-found).

5.3.0
latest
Source
npmnpm
Version published
Weekly downloads
293K
-3.72%
Maintainers
1
Weekly downloads
 
Created

What is file-set?

The file-set npm package allows you to easily include and exclude files using glob patterns. It is useful for tasks such as file manipulation, filtering, and organizing files based on specific patterns.

What are file-set's main functionalities?

Include Files

This feature allows you to include files that match a specific glob pattern. In this example, all JavaScript files in the 'src' directory and its subdirectories are included.

const fileSet = require('file-set');
fileSet('src/**/*.js', function(err, files) {
  if (err) throw err;
  console.log(files);
});

Exclude Files

This feature allows you to exclude files that match a specific glob pattern. In this example, all JavaScript files in the 'src' directory and its subdirectories are included, except for files named 'test.js'.

const fileSet = require('file-set');
fileSet(['src/**/*.js', '!src/**/test.js'], function(err, files) {
  if (err) throw err;
  console.log(files);
});

Multiple Patterns

This feature allows you to include files from multiple patterns. In this example, all JavaScript files in both the 'src' and 'lib' directories and their subdirectories are included.

const fileSet = require('file-set');
fileSet(['src/**/*.js', 'lib/**/*.js'], function(err, files) {
  if (err) throw err;
  console.log(files);
});

Other packages similar to file-set

Keywords

glob

FAQs

Package last updated on 17 Jul 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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.