@zkochan/rimraf
Advanced tools
Comparing version
@@ -1,32 +0,2 @@ | ||
/// <reference types="node" /> | ||
import glob = require('glob'); | ||
import fs = require('fs'); | ||
declare function rimraf(path: string, options?: rimraf.Options): Promise<void>; | ||
declare namespace rimraf { | ||
function sync(path: string, options?: Options): void; | ||
let EMFILE_MAX: number; | ||
let BUSYTRIES_MAX: number; | ||
interface Options { | ||
maxBusyTries?: number; | ||
emfileWait?: boolean; | ||
disableGlob?: boolean; | ||
glob?: glob.IOptions | false; | ||
unlink?: typeof fs.unlink; | ||
chmod?: typeof fs.chmod; | ||
stat?: typeof fs.stat; | ||
lstat?: typeof fs.lstat; | ||
rmdir?: typeof fs.rmdir; | ||
readdir?: typeof fs.readdir; | ||
unlinkSync?: typeof fs.unlinkSync; | ||
chmodSync?: typeof fs.chmodSync; | ||
statSync?: typeof fs.statSync; | ||
lstatSync?: typeof fs.lstatSync; | ||
rmdirSync?: typeof fs.rmdirSync; | ||
readdirSync?: typeof fs.readdirSync; | ||
} | ||
} | ||
export = rimraf; | ||
declare function rimraf(path: string): Promise<void> | ||
export = rimraf |
11
index.js
@@ -1,3 +0,10 @@ | ||
const { promisify } = require('util') | ||
const { promises: fs } = require('fs') | ||
module.exports = promisify(require('rimraf')) | ||
module.exports = async (p) => { | ||
try { | ||
await fs.rmdir(p, { recursive: true, maxRetries: 3 }) | ||
} catch (err) { | ||
if (err.code === 'ENOTDIR' || err.code === 'ENOENT') return | ||
throw err | ||
} | ||
} |
{ | ||
"name": "@zkochan/rimraf", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "rm -rf for Node. Similar to rimraf but returns a promise", | ||
@@ -26,9 +26,4 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@types/glob": "*", | ||
"@types/node": "14.14.6", | ||
"standard": "^16.0.3" | ||
}, | ||
"dependencies": { | ||
"rimraf": "^3.0.2" | ||
"standard": "^16.0.1" | ||
} | ||
} |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
0
-100%1
-66.67%2480
-27.23%5
-16.67%11
-63.33%2
100%- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed