Comparing version 0.0.1 to 0.1.0
var fs = require("fs"), | ||
glob = require("glob"), | ||
Glob = glob.Glob, | ||
w = require("wodge"); | ||
a = require("array-ting"); | ||
/** | ||
Expands file patterns, returning the matched and unmatched files and directories. | ||
@module | ||
@alias fileSet | ||
@example | ||
var FileSet = require("file-set"); | ||
var fileSet = FileSet([ "these/*.js", "those/*.txt" ]); | ||
*/ | ||
@@ -17,8 +13,13 @@ module.exports = FileSet; | ||
/** | ||
Pass files to constructor | ||
Expands file patterns, returning the matched and unmatched files and directories. | ||
Pass a list of file patterns to expand | ||
@class | ||
@alias module:file-set | ||
@param {string[]} files - The input files to stat | ||
@example | ||
var fileStats = new FileSet([ "lib/src/*", "test/*"]); | ||
@alias module:file-set | ||
```js | ||
var FileSet = require("file-set"); | ||
var fileSet = FileSet([ "these/*.js", "those/*.txt" ]); | ||
``` | ||
*/ | ||
@@ -59,3 +60,3 @@ function FileSet(files){ | ||
files = w.arrayify(files); | ||
files = a.arrayify(files); | ||
files.forEach(function(file){ | ||
@@ -66,3 +67,3 @@ try { | ||
if (!w.exists(self.list, fileSetItem)){ | ||
if (!a.exists(self.list, fileSetItem)){ | ||
if (stat.isFile()){ | ||
@@ -89,3 +90,3 @@ fileSetItem.type = FileSet.FILE; | ||
glob.found.forEach(function(file){ | ||
if (!w.exists(self.list, { path: file })){ | ||
if (!a.exists(self.list, { path: file })){ | ||
if (glob.cache[file] instanceof Array) glob.cache[file] = 2; | ||
@@ -92,0 +93,0 @@ var fileSetItem = { path: file, type: glob.cache[file] }; |
{ | ||
"name": "file-set", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"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.0.1", | ||
"jsdoc-to-markdown": "^0.1", | ||
"tape": "^2.13.2" | ||
}, | ||
"dependencies": { | ||
"glob": "^4.0.2", | ||
"wodge": "^0.7.0" | ||
"array-ting": "^1.0.4", | ||
"glob": "^4.0.2" | ||
} | ||
} |
@@ -7,31 +7,19 @@ [![view on npm](http://img.shields.io/npm/v/file-set.svg)](https://www.npmjs.org/package/file-set) | ||
#file-set API | ||
Expands file patterns, returning the matched and unmatched files and directories. | ||
#file-set | ||
####Examples | ||
```js | ||
var FileSet = require("file-set"); | ||
var fileSet = FileSet([ "these/*.js", "those/*.txt" ]); | ||
``` | ||
**Contents** | ||
* [list](#module_file-set#list) | ||
* [files](#module_file-set#files) | ||
* [dirs](#module_file-set#dirs) | ||
* [notExisting](#module_file-set#notExisting) | ||
* [add(files)](#module_file-set#add) | ||
##class: file-set | ||
- files `string[]` The input files to stat | ||
####Examples | ||
```js | ||
var fileStats = new FileSet([ "lib/src/*", "test/*"]); | ||
``` | ||
<a name="module_file-set#list"></a> | ||
###fileSet.list | ||
@@ -41,2 +29,3 @@ A list of unique paths, all which exist | ||
<a name="module_file-set#files"></a> | ||
###fileSet.files | ||
@@ -46,2 +35,3 @@ List of files which exist | ||
<a name="module_file-set#dirs"></a> | ||
###fileSet.dirs | ||
@@ -51,2 +41,3 @@ List of dirs which exist | ||
<a name="module_file-set#notExisting"></a> | ||
###fileSet.notExisting | ||
@@ -59,3 +50,4 @@ Paths which do not exist | ||
###fileSet.add(files) | ||
<a name="module_file-set#add"></a> | ||
###add(files) | ||
add files to the set | ||
@@ -77,1 +69,2 @@ | ||
Sorry, the diff of this file is not supported yet
6358
11
65
+ Addedarray-ting@^1.0.4
- Removedwodge@^0.7.0
- Removedwodge@0.7.0(transitive)