Socket
Socket
Sign inDemoInstall

filelist

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filelist

Lazy-evaluating list of files, based on globs or regex patterns


Version published
Weekly downloads
14M
decreased by-6.44%
Maintainers
1
Weekly downloads
 
Created

What is filelist?

The filelist npm package is a utility for managing and manipulating lists of file paths. It is commonly used in build systems and task runners to handle groups of files efficiently.

What are filelist's main functionalities?

Creating a FileList

This feature allows you to create a new FileList instance and include files matching a specific pattern. In this example, all JavaScript files in the 'src' directory and its subdirectories are included.

const FileList = require('filelist').FileList;
const files = new FileList();
files.include('src/**/*.js');
console.log(files.toArray());

Excluding Files

This feature allows you to exclude specific files from the FileList. In this example, all JavaScript files in the 'src' directory are included except for those named 'test.js'.

const FileList = require('filelist').FileList;
const files = new FileList();
files.include('src/**/*.js');
files.exclude('src/**/test.js');
console.log(files.toArray());

Refreshing the FileList

This feature allows you to refresh the FileList to ensure it is up-to-date with the current file system state. This is useful when files are added or removed during the execution of a script.

const FileList = require('filelist').FileList;
const files = new FileList();
files.include('src/**/*.js');
files.refresh();
console.log(files.toArray());

Other packages similar to filelist

Keywords

FAQs

Package last updated on 11 May 2022

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