Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

file-set

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

file-set - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

8

lib/file-set.js

@@ -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
};

8

package.json
{
"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.&lt;string&gt;</code>
* [.files](#module_file-set--FileSet#files) → <code>Array.&lt;string&gt;</code>
* [.dirs](#module_file-set--FileSet#dirs) → <code>Array.&lt;string&gt;</code>
* [.notExisting](#module_file-set--FileSet#notExisting) → <code>Array.&lt;string&gt;</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.&lt;string&gt;</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.&lt;string&gt;</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.&lt;string&gt;</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.&lt;string&gt;</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.&lt;string&gt;</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.&lt;string&gt;</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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc