Comparing version 0.3.0 to 0.3.2
@@ -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 |
{ | ||
"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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13558
152