@cocreate/lazy-loader 1.13.0 → 1.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.13.1](https://github.com/CoCreate-app/CoCreate-lazy-loader/compare/v1.13.0...v1.13.1) (2024-01-01)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * fs.access error handling ([e3e61f6](https://github.com/CoCreate-app/CoCreate-lazy-loader/commit/e3e61f69d0728e437ce7980862cb4c72aa9bb34f))
7
+
1
8
  # [1.13.0](https://github.com/CoCreate-app/CoCreate-lazy-loader/compare/v1.12.2...v1.13.0) (2023-12-31)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/lazy-loader",
3
- "version": "1.13.0",
3
+ "version": "1.13.1",
4
4
  "description": "A simple lazy-loader component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "lazy-loader",
package/src/server.js CHANGED
@@ -22,7 +22,10 @@ class CoCreateLazyLoader {
22
22
  async init() {
23
23
  const scriptsDirectory = './scripts';
24
24
 
25
- if (!await fs.access(scriptsDirectory)) {
25
+ try {
26
+ await fs.access(directory);
27
+ console.log("The directory exists.");
28
+ } catch (error) {
26
29
  try {
27
30
  await fs.mkdir(scriptsDirectory, { recursive: true });
28
31
  console.log(`Scripts directory created at ${scriptsDirectory}`);