dynamic-html-helpers 1.0.3 → 1.0.4

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/README.md CHANGED
@@ -6,9 +6,6 @@
6
6
  # HtmlHelpers
7
7
  Some handy helpers to create/maintain HTML pages.
8
8
 
9
-
10
-
11
-
12
9
  **The helper contains**
13
10
  - [x] A JQuery alike library to manage HTML elements (create, handle, modify, style, remove)
14
11
  - [x] A small string templating library
@@ -16,7 +13,7 @@ Some handy helpers to create/maintain HTML pages.
16
13
  - [x] A library to manage ES `Date` (format, locale sensitive/aware, calculation etc.)
17
14
  - [x] A logger factory to print text/html in a structured way to the browser screen
18
15
 
19
- ### [Examples](https://kooiinc.github.io/HTMLHelpers/Examples/)
16
+ ### [Examples](https://kooiinc.github.io/HTMLHelpers/Resource/Examples/)
20
17
 
21
18
  ### Use in Stackblitz front end project
22
19
  ```javascript
@@ -26,6 +23,16 @@ import {logFactory /*, ...[see 'exposed as']*/}
26
23
  ### Install the package
27
24
  `npm install dynamic-html-helpers`
28
25
 
26
+ ### Install the bundled code to a custom folder
27
+ This will install the bundled code files to a folder of choice.
28
+
29
+ **pre-requisites**
30
+
31
+ - [x] [nodejs](https://nodejs.org/en) must be installed.
32
+ - [x] [path to install to] must exist.
33
+
34
+ `npm run installBundleTo "[path to install to]"`
35
+
29
36
  ### Use as standalone script
30
37
  ```html
31
38
  <script src="https://unpkg.com/htmlhelpers@latest/Bundle/sbhelpers.script.min.js"></script>
@@ -0,0 +1,28 @@
1
+ import fs from "node:fs";
2
+
3
+ if (process.argv.length < 3) {
4
+ console.log(`Please supply a directory to install to`);
5
+ process.exit(1);
6
+ }
7
+
8
+ const directory2InstallTo = process.argv[2];
9
+
10
+ const directoryExists = fs.existsSync(directory2InstallTo);
11
+
12
+ if (!directoryExists) {
13
+ console.log(`It seems that [${directory2InstallTo}] does not exist.` +
14
+ ` Create it first please` );
15
+ process.exit(1);
16
+ }
17
+
18
+ const files = {
19
+ "htmlhelpers.min.js": fs.readFileSync(`./Bundle/htmlhelpers.min.js`),
20
+ "htmlhelpers.script.min.js": fs.readFileSync(`./Bundle/htmlhelpers.script.min.js`),
21
+ };
22
+
23
+ Object.entries(files).forEach( ([fileName, file]) => {
24
+ fs.writeFileSync(`${directory2InstallTo}/${fileName}`, file);
25
+ console.log(`File ${fileName} written to ${directory2InstallTo}`);
26
+ });
27
+
28
+ process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dynamic-html-helpers",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Helpers for ES/JS/HTML projects",
5
5
  "keywords": [
6
6
  "es20xx",
@@ -18,6 +18,9 @@
18
18
  "ticktock-es": "latest",
19
19
  "splat-es": "latest"
20
20
  },
21
+ "scripts": {
22
+ "installBundleTo": "node ./Resource/NpmScripts/installBundledToDirectory.js"
23
+ },
21
24
  "main": "./Bundle/htmlhelpers.min.js",
22
25
  "bugs": {
23
26
  "url": "https://codeberg.org/KooiInc/HtmlHelpers/issues"