Comparing version 8.2.2 to 9.0.0
26
index.js
@@ -1,8 +0,6 @@ | ||
"use strict"; | ||
import {readdir, stat, lstat} from "fs/promises"; | ||
import {readdirSync, statSync, lstatSync} from "fs"; | ||
import {sep} from "path"; | ||
import picomatch from "picomatch"; | ||
const {readdir, stat, lstat} = require("fs").promises; | ||
const {readdirSync, statSync, lstatSync} = require("fs"); | ||
const {sep} = require("path"); | ||
const picomatch = require("picomatch"); | ||
const sepBuffer = Buffer.from(sep); | ||
@@ -45,3 +43,3 @@ | ||
const rrdir = module.exports = async function* (dir, opts = {}, {includeMatcher, excludeMatcher, encoding} = {}) { | ||
export async function* rrdir(dir, opts = {}, {includeMatcher, excludeMatcher, encoding} = {}) { | ||
if (includeMatcher === undefined) { | ||
@@ -98,5 +96,5 @@ opts = Object.assign({}, defaults, opts); | ||
} | ||
}; | ||
} | ||
module.exports.async = async (dir, opts = {}, {includeMatcher, excludeMatcher, encoding} = {}) => { | ||
export async function rrdirAsync(dir, opts = {}, {includeMatcher, excludeMatcher, encoding} = {}) { | ||
if (includeMatcher === undefined) { | ||
@@ -152,9 +150,9 @@ opts = Object.assign({}, defaults, opts); | ||
if (recurse) results.push(...await module.exports.async(path, opts, {includeMatcher, excludeMatcher, encoding})); | ||
if (recurse) results.push(...await rrdirAsync(path, opts, {includeMatcher, excludeMatcher, encoding})); | ||
})); | ||
return results; | ||
}; | ||
} | ||
module.exports.sync = (dir, opts = {}, {includeMatcher, excludeMatcher, encoding} = {}) => { | ||
export function rrdirSync(dir, opts = {}, {includeMatcher, excludeMatcher, encoding} = {}) { | ||
if (includeMatcher === undefined) { | ||
@@ -209,6 +207,6 @@ opts = Object.assign({}, defaults, opts); | ||
if (recurse) results.push(...module.exports.sync(path, opts, {includeMatcher, excludeMatcher, encoding})); | ||
if (recurse) results.push(...rrdirSync(path, opts, {includeMatcher, excludeMatcher, encoding})); | ||
} | ||
return results; | ||
}; | ||
} |
{ | ||
"name": "rrdir", | ||
"version": "8.2.2", | ||
"version": "9.0.0", | ||
"description": "Recursive directory reader with a delightful API", | ||
@@ -9,7 +9,6 @@ "author": "silverwind <me@silverwind.io>", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "make test" | ||
}, | ||
"type": "module", | ||
"sideEffects": false, | ||
"engines": { | ||
"node": ">=10.10" | ||
"node": ">=14" | ||
}, | ||
@@ -20,13 +19,12 @@ "files": [ | ||
"dependencies": { | ||
"picomatch": "^2.2.2" | ||
"picomatch": "^2.3.1" | ||
}, | ||
"devDependencies": { | ||
"del": "6.0.0", | ||
"eslint": "7.21.0", | ||
"eslint-config-silverwind": "29.0.0", | ||
"jest": "26.6.3", | ||
"semver": "7.3.4", | ||
"tempy": "1.0.0", | ||
"updates": "11.4.3", | ||
"versions": "8.4.5" | ||
"eslint": "8.23.1", | ||
"eslint-config-silverwind": "54.0.2", | ||
"jest": "29.0.3", | ||
"semver": "7.3.7", | ||
"tempy": "3.0.0", | ||
"updates": "13.1.5", | ||
"versions": "9.3.0" | ||
}, | ||
@@ -33,0 +31,0 @@ "keywords": [ |
@@ -13,3 +13,3 @@ # rrdir | ||
```js | ||
const rrdir = require("rrdir"); | ||
import {rrdir, rrdirAsync, rrdirSync} from "rrdir"; | ||
@@ -20,6 +20,6 @@ for await (const entry of rrdir("dir")) { | ||
const entries = await rrdir.async("dir"); | ||
const entries = await rrdirAsync("dir"); | ||
// => [{path: 'dir/file', directory: false, symlink: false}] | ||
const entries = rrdir.sync("dir"); | ||
const entries = rrdirSync("dir"); | ||
// => [{path: 'dir/file', directory: false, symlink: false}] | ||
@@ -31,6 +31,6 @@ | ||
### `rrdir(dir, [options])` | ||
### `rrdir.async(dir, [options])` | ||
### `rrdir.sync(dir, [options])` | ||
### `rrdirAsync(dir, [options])` | ||
### `rrdirSync(dir, [options])` | ||
`rrdir` is an async iterator which yields `entry`. `rrdir.async` and `rrdir.sync` return an Array of `entry`. | ||
`rrdir` is an async iterator which yields `entry`. `rrdirAsync` and `rrdirSync` return an Array of `entry`. | ||
@@ -37,0 +37,0 @@ #### `dir` *String* | *Buffer* |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7
Yes
11007
175
Updatedpicomatch@^2.3.1