@ndriadev/futurable 2.3.3 → 3.0.0

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.
@@ -1,37 +0,0 @@
1
- import { readFile, readdir, writeFile } from 'fs/promises';
2
- import path from 'path';
3
-
4
- const __dirname = new URL('.', import.meta.url).pathname;
5
- const IMAGES_PATH = path.join(__dirname, "..", "resources", "images");
6
- const SEO_PATH = path.join(__dirname, "..", "resources", "seo");
7
- const DOCS_PATH = path.join(__dirname, "..", "docs");
8
-
9
- async function copy() {
10
- try {
11
- const [dir, dirSeo] = await Promise.all([
12
- readdir(IMAGES_PATH),
13
- readdir(SEO_PATH)
14
- ]);
15
- for (const file of dir) {
16
- const asset = await readFile(path.join(IMAGES_PATH, file));
17
- await writeFile(path.join(DOCS_PATH, file), asset);
18
- }
19
- for (const file of dirSeo) {
20
- if (file === "meta-tags.html") {
21
- const asset = await readFile(path.join(SEO_PATH, file), { encoding: "utf8" });
22
- let indexFile = await readFile(path.join(DOCS_PATH, "index.html"), {
23
- encoding: "utf8"
24
- });
25
- indexFile = indexFile.split("<head>")[0] + "<head>" + asset.split("\n").filter((_, index, arr) => index !== 0 && index !== arr.length - 1).join("") + indexFile.split("<head>")[1];
26
- await writeFile(path.join(DOCS_PATH, "index.html"), indexFile);
27
- } else {
28
- const asset = await readFile(path.join(SEO_PATH, file));
29
- await writeFile(path.join(DOCS_PATH, file), asset);
30
- }
31
- }
32
- } catch (error) {
33
- console.error(error);
34
- }
35
- }
36
-
37
- copy();
@@ -1,17 +0,0 @@
1
- // import { exec } from 'child_process';
2
-
3
- // const result = process.versions;
4
-
5
- // if (result && result.node && parseInt(result.node) < 16) {
6
- // exec("npm install node-fetch", (err, stdout, sterr) => {
7
- // if (err) {
8
- // console.log("err", err.message);
9
- // process.exit(1);
10
- // } else if (sterr) {
11
- // console.log("stderr", sterr);
12
- // process.exit(1);
13
- // }
14
- // console.log("stdout", stdout);
15
- // process.exit(0);
16
- // });
17
- // }
package/scripts/server.js DELETED
@@ -1,16 +0,0 @@
1
- import express from 'express';
2
- import path from 'path';
3
-
4
- const __dirname = new URL('.', import.meta.url).pathname;
5
-
6
- const app = express();
7
-
8
- app.use(express.static(path.join((__dirname, "..", "docs"))));
9
-
10
- app.get('/', (req, res) => {
11
- return res.sendFile(path.join(__dirname, '..', 'docs', 'index.html'))
12
- });
13
-
14
- app.listen(4173, () => {
15
- console.log("run");
16
- });