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

file-set

Package Overview
Dependencies
Maintainers
0
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

file-set

Expands file paths and glob expressions, returning matched and unmatched files and directories

  • 5.2.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
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

FAQs

Package last updated on 31 Aug 2024

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