@zkochan/rimraf
Advanced tools
Comparing version 2.1.1 to 2.1.2
10
index.js
@@ -1,9 +0,9 @@ | ||
const fs = require('fs') | ||
const rimraf = require('rimraf') | ||
const { promisify } = require('util') | ||
const rm = fs.promises.rm ? fs.promises.rm : fs.promises.rmdir | ||
const rmdirSync = fs.rmSync ? fs.rmSync : fs.rmdirSync | ||
const rimrafP = promisify(rimraf) | ||
module.exports = async (p) => { | ||
try { | ||
await rm(p, { recursive: true, maxRetries: 3 }) | ||
await rimrafP(p) | ||
} catch (err) { | ||
@@ -17,3 +17,3 @@ if (err.code === 'ENOTDIR' || err.code === 'ENOENT') return | ||
try { | ||
rmdirSync(p, { recursive: true, maxRetries: 3 }) | ||
rimraf.sync(p) | ||
} catch (err) { | ||
@@ -20,0 +20,0 @@ if (err.code === 'ENOTDIR' || err.code === 'ENOENT') return |
{ | ||
"name": "@zkochan/rimraf", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "rm -rf for Node. Similar to rimraf but returns a promise", | ||
@@ -11,9 +11,6 @@ "main": "index.js", | ||
], | ||
"scripts": { | ||
"test": "standard" | ||
}, | ||
"engines": { | ||
"node": ">=12.10" | ||
}, | ||
"repository": "https://github.com/zkochan/packages/tree/master/rimraf", | ||
"repository": "https://github.com/zkochan/packages/tree/main/rimraf", | ||
"author": { | ||
@@ -25,6 +22,13 @@ "name": "Zoltan Kochan", | ||
"license": "MIT", | ||
"homepage": "https://github.com/zkochan/packages/tree/master/rimraf#readme", | ||
"homepage": "https://github.com/zkochan/packages/tree/main/rimraf#readme", | ||
"devDependencies": { | ||
"standard": "^16.0.3" | ||
} | ||
} | ||
"standard": "^16.0.4" | ||
}, | ||
"dependencies": { | ||
"rimraf": "^3.0.2" | ||
}, | ||
"scripts": { | ||
"test": "standard" | ||
}, | ||
"readme": "# @zkochan/rimraf\n\n> rm -rf for Node. Similar to rimraf but returns a promise\n\n[![npm version](https://img.shields.io/npm/v/@zkochan/rimraf.svg)](https://www.npmjs.com/package/@zkochan/rimraf)\n\n## Installation\n\n```\n<npm|yarn|pnpm> add @zkochan/rimraf\n```\n\n## Usage\n\n```js\nconst rimraf = require('@zkochan/rimraf')\n\nawait rimraf('node_modules')\n```\n\n## License\n\n[MIT](LICENSE) © [Zoltan Kochan](https://www.kochan.io/)\n" | ||
} |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
3173
1
1
5
+ Addedrimraf@^3.0.2
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedrimraf@3.0.2(transitive)
+ Addedwrappy@1.0.2(transitive)