Comparing version 0.2.2 to 0.2.3
@@ -87,2 +87,4 @@ var fs = require("fs"), | ||
if (glob.cache[file] instanceof Array) glob.cache[file] = 2; | ||
if (glob.cache[file] === "FILE") glob.cache[file] = 1; | ||
if (glob.cache[file] === "DIR") glob.cache[file] = 2; | ||
var fileSetItem = { path: file, type: glob.cache[file] }; | ||
@@ -108,5 +110,11 @@ self.list.push(fileSetItem); | ||
FileSet.eFileType = { | ||
/** | ||
when a file doesn't exist | ||
*/ | ||
NOEXIST: 0, | ||
/** | ||
It's a file | ||
*/ | ||
FILE: 1, | ||
DIR: 2 | ||
}; |
{ | ||
"name": "file-set", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Expands file patterns, returning the matched and unmatched files and directories.", | ||
@@ -13,9 +13,9 @@ "main": "lib/file-set.js", | ||
"devDependencies": { | ||
"jsdoc-to-markdown": "^0.5.1", | ||
"tape": "^2.13.2" | ||
"jsdoc-to-markdown": "~0.6", | ||
"tape": "^3.0.3" | ||
}, | ||
"dependencies": { | ||
"array-tools": "^1.0.4", | ||
"glob": "~4.0.2" | ||
"glob": "^4.3.2" | ||
} | ||
} |
@@ -15,3 +15,2 @@ [![view on npm](http://img.shields.io/npm/v/file-set.svg)](https://www.npmjs.org/package/file-set) | ||
##Install | ||
@@ -44,63 +43,70 @@ ```sh | ||
#API | ||
<a name="module_file-set"></a> | ||
##class: FileSet ⏏ | ||
Expands file patterns, returning the matched and unmatched files and directories | ||
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`. | ||
**Members** | ||
**Example** | ||
```js | ||
var fileSet = require("file-set"); | ||
``` | ||
* [class: FileSet ⏏](#module_file-set) | ||
* [new FileSet(patternList)](#module_file-set) | ||
* [fileSet.list](#module_file-set#list) | ||
* [fileSet.files](#module_file-set#files) | ||
* [fileSet.dirs](#module_file-set#dirs) | ||
* [fileSet.notExisting](#module_file-set#notExisting) | ||
* [enum: FileSet.eFileType](#module_file-set.eFileType) | ||
* [eFileType.NOEXIST](#module_file-set.eFileType.NOEXIST) | ||
* [eFileType.FILE](#module_file-set.eFileType.FILE) | ||
* [eFileType.DIR](#module_file-set.eFileType.DIR) | ||
* [fileSet.add(files)](#module_file-set#add) | ||
* [file-set](#module_file-set) | ||
* [class: FileSet](#exp_module_file-set--FileSet) ⏏ | ||
* [new FileSet(patternList)](#new_module_file-set--FileSet_new) | ||
* _instance_ | ||
* [.list](#module_file-set--FileSet#list) → <code>Array.<string></code> | ||
* [.files](#module_file-set--FileSet#files) → <code>Array.<string></code> | ||
* [.dirs](#module_file-set--FileSet#dirs) → <code>Array.<string></code> | ||
* [.notExisting](#module_file-set--FileSet#notExisting) → <code>Array.<string></code> | ||
* [.add(files)](#module_file-set--FileSet#add) | ||
* _static_ | ||
* [enum: .eFileType](#module_file-set--FileSet.eFileType) → <code>number</code> | ||
<a name="module_file-set"></a> | ||
###new FileSet(patternList) | ||
**Params** | ||
<a name="exp_module_file-set--FileSet"></a> | ||
###class: FileSet ⏏ | ||
Expands file patterns, returning the matched and unmatched files and directories | ||
- patternList `string` | `Array.<string>` - A pattern, or array of patterns to expand | ||
<a name="new_module_file-set--FileSet_new"></a> | ||
####new FileSet(patternList) | ||
| Param | Type | Description | | ||
| ----- | ---- | ----------- | | ||
| patternList | <code>string</code> \| <code>Array.<string></code> | A pattern, or array of patterns to expand | | ||
<a name="module_file-set#list"></a> | ||
###fileSet.list | ||
<a name="module_file-set--FileSet#list"></a> | ||
####fileSet.list → <code>Array.<string></code> | ||
The full list of unique paths found, and not found. | ||
**Type**: `Array.<string>` | ||
<a name="module_file-set#files"></a> | ||
###fileSet.files | ||
<a name="module_file-set--FileSet#files"></a> | ||
####fileSet.files → <code>Array.<string></code> | ||
The existing files found | ||
**Type**: `Array.<string>` | ||
<a name="module_file-set#dirs"></a> | ||
###fileSet.dirs | ||
<a name="module_file-set--FileSet#dirs"></a> | ||
####fileSet.dirs → <code>Array.<string></code> | ||
The existing directories found | ||
**Type**: `Array.<string>` | ||
<a name="module_file-set#notExisting"></a> | ||
###fileSet.notExisting | ||
<a name="module_file-set--FileSet#notExisting"></a> | ||
####fileSet.notExisting → <code>Array.<string></code> | ||
Paths which were not found | ||
**Type**: `Array.<string>` | ||
<a name="module_file-set.eFileType"></a> | ||
###enum: FileSet.eFileType | ||
<a name="module_file-set--FileSet#add"></a> | ||
####fileSet.add(files) | ||
add file patterns to the set | ||
| Param | Type | Description | | ||
| ----- | ---- | ----------- | | ||
| files | <code>string</code> \| <code>Array.<string></code> | A pattern, or array of patterns to expand | | ||
<a name="module_file-set--FileSet.eFileType"></a> | ||
####enum: FileSet.eFileType → <code>number</code> | ||
Enum for the `type` value of each record in `fileSet.list` | ||
**Type**: `number` | ||
**Properties**: `NOEXIST`, `FILE`, `DIR` | ||
**Read only**: true | ||
<a name="module_file-set#add"></a> | ||
###fileSet.add(files) | ||
add file patterns to the set | ||
**Properties** | ||
**Params** | ||
| Name | Type | Default | Description | | ||
| ---- | ---- | ------- |----------- | | ||
| NOEXIST | <code>number</code> | `0` | when a file doesn't exist | | ||
| FILE | <code>number</code> | `1` | It's a file | | ||
| DIR | <code>number</code> | `2` | | | ||
- files `string` | `Array.<string>` - A pattern, or array of patterns to expand | ||
**Read only**: true | ||
*documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown)* |
Sorry, the diff of this file is not supported yet
10545
147
111
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedglob@4.5.3(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedminimatch@2.0.10(transitive)
- Removedglob@4.0.6(transitive)
- Removedgraceful-fs@3.0.12(transitive)
- Removedlru-cache@2.7.3(transitive)
- Removedminimatch@1.0.0(transitive)
- Removednatives@1.1.6(transitive)
- Removedsigmund@1.0.1(transitive)
Updatedglob@^4.3.2