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).
Last updated 9 months ago by 75lb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm 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

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>.

Current Tags

  • 5.3.0                                ...           latest (9 months ago)
  • 1.1.2                                ...           prev (8 years ago)

37 Versions

  • 5.3.0                                ...           9 months ago
  • 5.2.2                                ...           2 years ago
  • 5.2.1                                ...           2 years ago
  • 5.2.0                                ...           2 years ago
  • 6.0.1 [deprecated]           ...           2 years ago
  • 6.0.0 [deprecated]           ...           2 years ago
  • 5.1.3                                ...           4 years ago
  • 5.1.2                                ...           5 years ago
  • 5.1.1                                ...           5 years ago
  • 5.1.0                                ...           5 years ago
  • 5.0.1                                ...           5 years ago
  • 5.0.0                                ...           5 years ago
  • 4.0.2                                ...           5 years ago
  • 4.0.1                                ...           6 years ago
  • 4.0.0                                ...           6 years ago
  • 3.0.0                                ...           6 years ago
  • 1.1.2                                ...           8 years ago
  • 2.0.1                                ...           8 years ago
  • 2.0.0                                ...           8 years ago
  • 1.1.1                                ...           10 years ago
  • 1.1.0                                ...           10 years ago
  • 1.0.2                                ...           10 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
  • 0.2.8                                ...           10 years ago
  • 0.2.7                                ...           11 years ago
  • 0.2.6                                ...           11 years ago
  • 0.2.5                                ...           11 years ago
  • 0.2.4                                ...           11 years ago
  • 0.2.3                                ...           11 years ago
  • 0.2.2                                ...           11 years ago
  • 0.2.1                                ...           12 years ago
  • 0.2.0                                ...           12 years ago
  • 0.1.1                                ...           12 years ago
  • 0.1.0                                ...           12 years ago
  • 0.0.1                                ...           12 years ago
  • 0.0.0                                ...           12 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (0)
None

Copyright 2013 - present © cnpmjs.org | Home |