Skip to content

Latest commit

 

History

History
92 lines (63 loc) · 3.38 KB

README.md

File metadata and controls

92 lines (63 loc) · 3.38 KB

view on npm npm module downloads Gihub repo dependents Gihub package dependents Build Status js-standard-style

file-set

Expands a list of paths and glob expressions into three sets: "files", "directories" and "not existing". Each set in the output is a list of unique paths.

Usage

Expand two glob expressions ('*' and 'not/existing/*').

const FileSet = require('file-set')
const fileSet = new FileSet([ '*', 'not/existing/*' ])
console.log(fileSet)

The output has been organised into sets.

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

API

file-set

FileSet ⏏

Kind: Exported class

new FileSet(patternList)

Param Type Description
patternList string | Array.<string> One or more file paths or glob expressions to inspect.

fileSet.files : Array.<string>

The existing files found

Kind: instance property of FileSet

fileSet.dirs : Array.<string>

The existing directories found

Kind: instance property of FileSet

fileSet.notExisting : Array.<string>

Paths which were not found

Kind: instance property of FileSet

fileSet.add(files)

Add file patterns to the set.

Kind: instance method of FileSet

Param Type Description
files string | Array.<string> One or more file paths or glob expressions to inspect.

© 2014-21 Lloyd Brookes <[email protected]>.

Tested by test-runner. Documented by jsdoc-to-markdown.