mem-fs-editor
Advanced tools
@@ -11,3 +11,3 @@ import fs from 'fs/promises'; | ||
| if (!(await fs.stat(dir)).isDirectory()) { | ||
| throw new Error(`${file.path} is not a directory`); | ||
| throw new Error(`${dir} is not a directory`); | ||
| } | ||
@@ -14,0 +14,0 @@ } |
@@ -1,3 +0,2 @@ | ||
| import { Duplex } from 'stream'; | ||
| import type { MemFsEditorFile } from './index.js'; | ||
| export declare const createCommitTransform: <EditorFile extends MemFsEditorFile = MemFsEditorFile>() => Duplex; | ||
| import { Transform } from 'stream'; | ||
| export declare const createCommitTransform: () => Transform; |
@@ -1,8 +0,8 @@ | ||
| import { Duplex } from 'stream'; | ||
| import { Transform } from 'stream'; | ||
| import commitFileAsync from './actions/commit-file-async.js'; | ||
| export const createCommitTransform = () => Duplex.from(async function* (generator) { | ||
| for await (const file of generator) { | ||
| await commitFileAsync(file); | ||
| yield file; | ||
| } | ||
| export const createCommitTransform = () => new Transform({ | ||
| objectMode: true, | ||
| transform(file, _encoding, callback) { | ||
| commitFileAsync(file).then(() => callback(null, file), (error) => callback(error)); | ||
| }, | ||
| }); |
+18
-18
| { | ||
| "name": "mem-fs-editor", | ||
| "version": "11.1.3", | ||
| "version": "11.1.4", | ||
| "description": "File edition helpers working on top of mem-fs", | ||
| "type": "module", | ||
| "scripts": { | ||
| "build": "tsc", | ||
| "fix": "eslint . --fix", | ||
| "prepare": "npm run build", | ||
| "pretest": "eslint .", | ||
| "test": "vitest --run" | ||
| }, | ||
| "repository": "SBoudrias/mem-fs-editor", | ||
| "license": "MIT", | ||
| "author": "Simon Boudrias", | ||
| "license": "MIT", | ||
| "main": "./dist/index.js", | ||
| "types": "./dist/index.d.ts", | ||
| "type": "module", | ||
| "exports": { | ||
@@ -32,5 +23,14 @@ ".": { | ||
| }, | ||
| "main": "./dist/index.js", | ||
| "types": "./dist/index.d.ts", | ||
| "files": [ | ||
| "dist" | ||
| ], | ||
| "scripts": { | ||
| "build": "tsc", | ||
| "fix": "eslint . --fix", | ||
| "prepare": "npm run build", | ||
| "pretest": "eslint .", | ||
| "test": "vitest --run" | ||
| }, | ||
| "dependencies": { | ||
@@ -51,8 +51,2 @@ "@types/ejs": "^3.1.4", | ||
| }, | ||
| "peerDependencies": { | ||
| "mem-fs": "^4.0.0" | ||
| }, | ||
| "acceptDependencies": { | ||
| "isbinaryfile": "^5.0.3" | ||
| }, | ||
| "devDependencies": { | ||
@@ -74,5 +68,11 @@ "@typescript-eslint/eslint-plugin": "^7.18.0", | ||
| }, | ||
| "peerDependencies": { | ||
| "mem-fs": "^4.0.0" | ||
| }, | ||
| "engines": { | ||
| "node": ">=18.0.0" | ||
| }, | ||
| "acceptDependencies": { | ||
| "isbinaryfile": "^5.0.3" | ||
| } | ||
| } |
+1
-1
@@ -19,3 +19,3 @@ # mem-fs-editor | ||
| fs.write('somefile.js', 'var a = 1;'); | ||
| await fs.commit() | ||
| await fs.commit(); | ||
| ``` | ||
@@ -22,0 +22,0 @@ |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances in 1 package
46027
-0.15%871
-0.11%