Comparing version 0.0.2 to 0.0.3
10
index.js
@@ -32,4 +32,14 @@ const p = require('path') | ||
} | ||
static async exists(file) { | ||
return fs.promises.access(file, fs.constants.F_OK) | ||
.then(() => true).catch(() => false) | ||
} | ||
async exists(file) { | ||
return fs.promises.access(file, fs.constants.F_OK) | ||
.then(() => true).catch(() => false) | ||
} | ||
} | ||
module.exports = Hotfile |
{ | ||
"name": "hotfile", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -63,16 +63,11 @@ # hotfile | ||
} | ||
/* rewriting map function with default settings */ | ||
static async map(path, options = {}){ | ||
const items = await this.readdir(path, options) | ||
for(let i = 0; i < items.length; i++){ | ||
if(items[i].isDirectory) items[i].children = await this.map(items[i].path, options) | ||
} | ||
return items | ||
return await super.map(path, { | ||
exclude: /(^|\/)\.[^\/\.]/g, | ||
model: this | ||
}) | ||
} | ||
static async mkdir(path){ | ||
return fs.promises.mkdir(path, { recursive: true }) | ||
.then(() => new Hotfile(path)).catch(() => false) | ||
} | ||
async rename(name, ext){ | ||
@@ -79,0 +74,0 @@ if(ext) this.ext = ext |
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
4903
36
115