Launch Week Day 2: Introducing Reports: An Extensible Reporting Framework for Socket Data.Learn More
Socket
Book a DemoSign 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).

latest
Source
npmnpm
Version
5.3.0
Version published
Weekly downloads
311K
2.27%
Maintainers
1
Weekly downloads
 
Created
Source

view on npm npm module downloads Gihub repo dependents Gihub package dependents Node.js CI

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). It handles all the cross-platform issues associated with file paths.

Particularly useful for handling user input, for example a CLI utility which accepts a list of file paths and globs.

$ example-utility index.js * not/existing/*

The example-utility above could pass its user input into FileSet. Call await .add(<string[]>) as many times as necessary, adding more path/glob expressions each time.

import FileSet from 'file-set'
const fileSet = new FileSet()
await fileSet.add([ 'index.js', '*', 'not/existing/*' ])
console.log(fileSet)

The output has been organised into sets. Any duplicates caused by overlapping glob expressions are removed.

FileSet {
  files: [ 'index.js', 'LICENSE', 'package.json', 'README.md' ],
  dirs: [ 'jsdoc2md/', 'lib/', 'node_modules/', 'test/' ],
  notExisting: [ 'not/existing/*' ]
}

© 2014-25 Lloyd Brookes <opensource@75lb.com>.

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