+6
-1
@@ -7,2 +7,5 @@ const fs = require('fs') | ||
| constructor(path, options = {}) { | ||
| if(options.mkdir && !Hotfile.existsSync(path)){ | ||
| Hotfile.mkdirSync(path) | ||
| } | ||
| const stat = fs.lstatSync(path) | ||
@@ -127,3 +130,4 @@ const { ext, name, base } = parse(path) | ||
| async moveTo(destinationPath) { | ||
| async moveTo(destinationPath, options = {}) { | ||
| const { replace } = options | ||
| const hotfolder = destinationPath instanceof Hotfile | ||
@@ -136,2 +140,3 @@ ? destinationPath | ||
| this.updatePath(newPath) | ||
| if(await this.exists(newPath) && !replace) return null | ||
| await fs.promises.rename(oldPath, newPath) | ||
@@ -138,0 +143,0 @@ return this |
+1
-1
| { | ||
| "name": "hotfile", | ||
| "version": "0.3.0", | ||
| "version": "0.3.2", | ||
| "description": "Hotfile makes working with folders and files in node-js easy and clear.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
13558
1.61%152
3.4%