file-set
Expands file paths and glob expressions, returning matched and unmatched files and directories
Last updated 3 years ago by 75lb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install file-set 
SYNC missed versions from official npm registry.

view on npm npm module downloads Gihub repo dependents Gihub package dependents Node.js CI 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.

The library saves you the job of learning a globbing library, expanding a glob expression (e.g. lib/**/*), sifting through each result testing whether it's a file, directory or neither.

Usage

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

import FileSet from 'file-set'
const fileSet = new FileSet()
await fileSet.add([ '*', '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()

fileSet.files : Array.<string>

The existing files found

Kind: instance property of FileSet

fileSet.dirs : Array.<string>

The existing directories found. Directory paths will always end with '/'.

Kind: instance property of FileSet

fileSet.notExisting : Array.<string>

Paths which were not found

Kind: instance property of FileSet

fileSet.add(patterns)

Add file patterns to the set.

Kind: instance method of FileSet

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

© 2014-21 Lloyd Brookes <75pound@gmail.com>.

Tested by test-runner.

Current Tags

  • 5.1.3                                ...           latest (3 years ago)
  • 1.1.2                                ...           prev (6 years ago)

31 Versions

  • 5.1.3                                ...           3 years ago
  • 5.1.2                                ...           3 years ago
  • 5.1.1                                ...           3 years ago
  • 5.1.0                                ...           3 years ago
  • 5.0.1                                ...           3 years ago
  • 5.0.0                                ...           3 years ago
  • 4.0.2                                ...           4 years ago
  • 4.0.1                                ...           5 years ago
  • 4.0.0                                ...           5 years ago
  • 3.0.0                                ...           5 years ago
  • 1.1.2                                ...           6 years ago
  • 2.0.1                                ...           6 years ago
  • 2.0.0                                ...           7 years ago
  • 1.1.1                                ...           8 years ago
  • 1.1.0                                ...           8 years ago
  • 1.0.2                                ...           8 years ago
  • 1.0.1                                ...           8 years ago
  • 1.0.0                                ...           9 years ago
  • 0.2.8                                ...           9 years ago
  • 0.2.7                                ...           10 years ago
  • 0.2.6                                ...           10 years ago
  • 0.2.5                                ...           10 years ago
  • 0.2.4                                ...           10 years ago
  • 0.2.3                                ...           10 years ago
  • 0.2.2                                ...           10 years ago
  • 0.2.1                                ...           10 years ago
  • 0.2.0                                ...           10 years ago
  • 0.1.1                                ...           10 years ago
  • 0.1.0                                ...           10 years ago
  • 0.0.1                                ...           10 years ago
  • 0.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (2)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |