Socket
Socket
Sign inDemoInstall

fast-glob

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-glob - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

appveyor.yml

0

out/fglob.d.ts

@@ -0,0 +0,0 @@ import { IEntry } from 'readdir-enhanced';

2

out/fglob.js
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
const task = require("./utils/task");

@@ -42,3 +43,2 @@ const readdir = require("./providers/readdir");

}
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = async;

@@ -45,0 +45,0 @@ function sync(source, options) {

@@ -0,0 +0,0 @@ import * as readdir from 'readdir-enhanced';

'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("fs");

@@ -48,3 +49,3 @@ const bglob = require("bash-glob");

const cb = options.transform ? options.transform : (entry) => entry;
const files = bglob.sync(patterns, { dotglob: true });
const files = bglob.sync(patterns, { cwd: options.cwd, dotglob: true });
const entries = filterByNegativePatterns(files, task.patterns);

@@ -51,0 +52,0 @@ if (options.stats || options.onlyFiles || options.onlyDirs) {

@@ -0,0 +0,0 @@ import * as readdir from 'readdir-enhanced';

'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
const readdir = require("readdir-enhanced");
const micromatch = require("micromatch");
function isEnoentCodeError(err) {
return err.code === 'ENOENT';
}
function filter(entry, patterns, options) {

@@ -15,3 +19,3 @@ if ((options.onlyFiles && !entry.isFile()) || (options.onlyDirs && !entry.isDirectory())) {

function async(task, options) {
const cwd = path.join(options.cwd, task.base);
const cwd = path.resolve(options.cwd, task.base);
const entries = [];

@@ -28,3 +32,3 @@ const api = options.stats ? readdir.readdirStreamStat : readdir.stream;

stream.on('data', (entry) => entries.push(cb(entry)));
stream.on('error', (err) => reject(err));
stream.on('error', (err) => isEnoentCodeError(err) ? resolve([]) : reject(err));
stream.on('end', () => resolve(entries));

@@ -35,13 +39,21 @@ });

function sync(task, options) {
const cwd = path.join(options.cwd, task.base);
const api = options.stats ? readdir.readdirSyncStat : readdir.sync;
const cb = options.transform ? options.transform : (entry) => entry;
const entries = api(cwd, {
filter: (entry) => filter(entry, task.patterns, options),
basePath: task.base === '.' ? '' : task.base,
deep: options.deep,
sep: '/'
});
return options.transform ? entries.map(cb) : entries;
const cwd = path.resolve(options.cwd, task.base);
try {
const api = options.stats ? readdir.readdirSyncStat : readdir.sync;
const cb = options.transform ? options.transform : (entry) => entry;
const entries = api(cwd, {
filter: (entry) => filter(entry, task.patterns, options),
basePath: task.base === '.' ? '' : task.base,
deep: options.deep,
sep: '/'
});
return options.transform ? entries.map(cb) : entries;
}
catch (err) {
if (isEnoentCodeError(err)) {
return [];
}
throw err;
}
}
exports.sync = sync;
/// <reference types="node" />
import * as fs from 'fs';
export declare function statFile(filepath: string): Promise<fs.Stats>;
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("fs");

@@ -3,0 +4,0 @@ function statFile(filepath) {

export declare function isNegative(pattern: string): boolean;
export declare function getNegativeAsPositive(patterns: string[]): string[];
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
function isNegative(pattern) {

@@ -3,0 +4,0 @@ return pattern[0] === '!';

@@ -0,0 +0,0 @@ import { IOptions } from '../fglob';

'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
const globParent = require("glob-parent");

@@ -3,0 +4,0 @@ function generateTasks(patterns, options) {

{
"name": "fast-glob",
"version": "1.0.0",
"version": "1.0.1",
"description": "Is a faster `node-glob` alternative",

@@ -23,18 +23,18 @@ "license": "MIT",

"@types/micromatch": "^2.3.29",
"@types/mocha": "^2.2.34",
"@types/node": "^6.0.52",
"@types/mocha": "^2.2.41",
"@types/node": "^7.0.27",
"@types/rimraf": "0.0.28",
"fs-extra": "^1.0.0",
"glob": "^7.1.1",
"mocha": "^3.2.0",
"rimraf": "^2.5.4",
"tslint": "^4.2.0",
"tslint-config-xo": "^1.0.0",
"typescript": "^2.1.4"
"fs-extra": "^3.0.1",
"glob": "^7.1.2",
"mocha": "^3.4.2",
"rimraf": "^2.6.1",
"tslint": "^5.4.2",
"tslint-config-xo": "^1.2.0",
"typescript": "^2.3.4"
},
"dependencies": {
"bash-glob": "^0.1.1",
"bash-glob": "^1.0.1",
"glob-parent": "^3.1.0",
"micromatch": "^2.3.11",
"readdir-enhanced": "^1.4.5"
"micromatch": "^3.0.3",
"readdir-enhanced": "^1.5.2"
},

@@ -41,0 +41,0 @@ "scripts": {

@@ -16,3 +16,3 @@ # fast-glob

* You can get not only file paths, but also their `fs.Stats` objects with the additional `path` property.
* You can transform file path or `fs.Stats` object before sending it to an array (only for async).
* You can transform file path or `fs.Stats` object before sending it to an array.

@@ -19,0 +19,0 @@ ## Usage

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