Socket
Socket
Sign inDemoInstall

@jsenv/filesystem

Package Overview
Dependencies
2
Maintainers
2
Versions
62
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.2.0 to 2.3.0

src/listFilesMatching.js

1

main.js

@@ -29,2 +29,3 @@ /* eslint-disable import/max-dependencies */

export { isFileSystemPath } from "./src/isFileSystemPath.js"
export { listFilesMatching } from "./src/listFilesMatching.js"
export { memoize } from "./src/memoize.js"

@@ -31,0 +32,0 @@ export { moveDirectoryContent } from "./src/moveDirectoryContent.js"

2

package.json
{
"name": "@jsenv/filesystem",
"version": "2.2.0",
"version": "2.3.0",
"description": "Collection of functions to interact with filesystem in Node.js",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -16,22 +16,20 @@ # Jsenv filesystem [![npm package](https://img.shields.io/npm/v/@jsenv/filesystem.svg?logo=npm&label=package)](https://www.npmjs.com/package/@jsenv/filesystem) [![github main](https://github.com/jsenv/filesystem/workflows/main/badge.svg)](https://github.com/jsenv/filesystem/actions?workflow=main) [![codecov coverage](https://codecov.io/gh/jsenv/filesystem/branch/main/graph/badge.svg)](https://codecov.io/gh/jsenv/filesystem)

## Collect files using pattern matching
## List files using pattern matching
```js
import { collectFiles } from "@jsenv/filesystem"
import { listFilesMatching } from "@jsenv/filesystem"
const jsAndSourceMapFiles = await collectFiles({
directoryUrl: "file:///project/directory/",
structuredMetaMap: {
isJsFile: {
"./**/*.js": true,
},
isSourceMapFile: {
"./**/*.js.map": true,
},
},
predicate: ({ isJsFile, isSourceMapFile }) => isJsFile || isSourceMapFile,
})
console.log(jsAndSourceMapFiles.length)
const jsFiles = await listFilesMatching(
"./**/*.js",
new URL("./", import.meta.url),
)
```
```console
[
'file:///Users/dmail/docs/demo/a.js',
'file:///Users/dmail/docs/demo/b.js'
]
```
## Watch a specific file changes

@@ -38,0 +36,0 @@

@@ -99,2 +99,3 @@ import { createCancellationToken, createOperation } from "@jsenv/cancellation"

matchingFileResultArray.push({
url: new URL(relativeUrl, directoryUrl).href,
relativeUrl,

@@ -101,0 +102,0 @@ meta,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc