Comparing version 0.3.3 to 0.3.4
@@ -121,6 +121,13 @@ const fs = require('fs') | ||
updateMetadata(newPath){ | ||
this.path = newPath | ||
const { name, base, ext } = parse(newPath) | ||
Object.assign(this, { name, base, ext }) | ||
return this | ||
} | ||
async rename(newbase) { | ||
const oldPath = this.path | ||
const newPath = this.path.replace(this.base, newbase) | ||
this.updatePath(newPath) | ||
this.updateMetadata(newPath) | ||
await fs.promises.rename(oldPath, newPath) | ||
@@ -127,0 +134,0 @@ return this |
{ | ||
"name": "hotfile", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"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
13749
158