file-set

Expands file patterns, returning the matched and unmatched files and directories.

file-set

Exports a contructor taking a list of file patterns as input, returning a file-set instance containing the expanded patterns split into separate lists of files, dirs and notExisting.

Example

var fileSet = require("file-set");
$ npm install file-set --save
> var fileSet = require("file-set");
> var ls = fileSet([ "*", "not/existing/*" ])
{ list:
   [ { path: 'README.md', type: 1 },
     { path: 'jsdoc2md', type: 2 },
     { path: 'lib', type: 2 },
     { path: 'node_modules', type: 2 },
     { path: 'package.json', type: 1 },
     { path: 'test', type: 2 },
     { path: 'not/existing/*', type: 0 } ],
  files: [ 'README.md', 'package.json' ],
  dirs:
   [ 'jsdoc2md',
     'lib',
     'node_modules',
     'test' ],
  notExisting: [ 'not/existing/*' ] }

API

Exports a contructor taking a list of file patterns as input, returning a file-set instance containing the expanded patterns split into separate lists of files, dirs and notExisting.

Example

var fileSet = require("file-set");

Expands file patterns, returning the matched and unmatched files and directories

Kind: Exported class

ParamTypeDescription
patternListstring \Array.<string>A pattern, or array of patterns to expand

The full list of unique paths found, and not found.

Kind: instance property of FileSet

The existing files found

Kind: instance property of FileSet

The existing directories found

Kind: instance property of FileSet

Paths which were not found

Kind: instance property of FileSet

add file patterns to the set

Kind: instance method of FileSet

ParamTypeDescription
filesstring \Array.<string>A pattern, or array of patterns to expand

Enum for the type value of each record in fileSet.list

Kind: static enum property of FileSet
Read only: true
Properties

NameTypeDefaultDescription
NOEXISTnumber0when a file doesn't exist
FILEnumber1It's a file
DIRnumber2

documented by jsdoc-to-markdown