live-directory
Advanced tools
Comparing version 2.2.0 to 2.3.0
{ | ||
"name": "live-directory", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "A Simple-To-Use Dynamic File Content Manager For Webservers", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -173,2 +173,3 @@ # LiveDirectory: Dynamic File Content Manager | ||
| `path` | `String` | System file path. | | ||
| `name` | `String` | File name. | | ||
| `extension` | `String` | File extension. | | ||
@@ -175,0 +176,0 @@ | `etag` | `String` | Unique etag compatible file hash. | |
@@ -323,5 +323,7 @@ const EventEmitter = require('events'); | ||
reference.#ready_resolve(); | ||
reference.#ready_promise = true; | ||
reference.#ready_resolve = null; | ||
} | ||
// Mark instance as ready | ||
reference.#ready_promise = true; | ||
}); | ||
@@ -328,0 +330,0 @@ } |
@@ -6,2 +6,3 @@ const etag = require('etag'); | ||
class LiveFile { | ||
#name; | ||
#etag; | ||
@@ -24,2 +25,6 @@ #extension; | ||
// Determine the name of the file | ||
const chunks = options.path.split('/'); | ||
this.#name = chunks[chunks.length - 1]; | ||
// Determine the extension of the file | ||
@@ -99,2 +104,3 @@ this.#extension = this.#options.path.split('.'); | ||
} | ||
this.#ready_promise = true; | ||
} | ||
@@ -119,2 +125,6 @@ | ||
/* LiveFile Getters */ | ||
get name() { | ||
return this.#name; | ||
} | ||
get path() { | ||
@@ -121,0 +131,0 @@ return this.#options.path; |
33998
597
185