script.io.js 2026.126.106 → 2026.126.2039

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/index.js CHANGED
@@ -3,5 +3,7 @@ require ("./node_packages/html.js");
3
3
  Function.path.require ();
4
4
  Function.file.require ();
5
5
  Function.hash.require ();
6
+ Function.mongo.require ();
7
+ Function.socket.require ();
6
8
  Function.appwrite.require ();
7
9
  module.exports = exports = Symbol.export;
@@ -70,7 +70,6 @@ Define (Function, "html", class {
70
70
  constructor () {
71
71
  this.populated = false;
72
72
  this.head = new Function.html.head (this);
73
- this.config = {}
74
73
  this.var = {
75
74
  "html:attribute": {},
76
75
  title: "UnTitled",
@@ -129,9 +128,9 @@ Define (Function, "html", class {
129
128
  for (var i in this.var.meta) this.head.meta (this.var.meta [i].attribute, this.var.meta [i].prop);
130
129
  this.head.link ({rel: "icon", href: this.var ["favorite.ico"] || "/favicon.ico"});
131
130
  this.head.link ({rel: "canonical", href: this.var.canonical || "/"});
132
- if (this.config ["manifest.json"]) this.head.link ({rel: "manifest", href: this.var ["manifest.json"] || "/manifest.json"});
133
- if (this.config ["feed.xml"]) this.head.link ({rel: "alternate", href: "/feed/", type: "application/rss+xml", title: "{{ site:name }} » Feed"});
134
- if (this.config ["feed.xml:atom"]) this.head.link ({rel: "alternate", href: "/feed/atom/", type: "application/rss+xml", title: "{{ site:name }} » Feed (Atom)"});
131
+ if (this.var ["manifest.json"]) this.head.link ({rel: "manifest", href: this.var ["manifest.json"] || "/manifest.json"});
132
+ if (this.var ["feed.xml"]) this.head.link ({rel: "alternate", href: "/feed/", type: "application/rss+xml", title: "{{ site:name }} » Feed"});
133
+ if (this.var ["feed.xml:atom"]) this.head.link ({rel: "alternate", href: "/feed/atom/", type: "application/rss+xml", title: "{{ site:name }} » Feed (Atom)"});
135
134
  this.head.link ({rel: "dns-prefetch", href: "https://www.google-analytics.com"});
136
135
  this.head.link ({rel: "dns-prefetch", href: "https://www.googletagmanager.com"});
137
136
  this.head.link ({rel: "preconnect", href: "https://fonts.gstatic.com"}, "crossorigin");
@@ -162,7 +161,7 @@ Define (Function, "html", class {
162
161
  }
163
162
  render (body) {
164
163
  if (this.populated) {}
165
- else this.populate (variable);
164
+ else this.populate ();
166
165
  this.markup = new Function.html.markup (`<!DOCTYPE html>`);
167
166
  this.markup.push (0, `<html${Function.html.attribute (this.var ["html:attribute"], {space: true})}>`);
168
167
  this.markup.push (1, `<head>`);
@@ -194,18 +193,19 @@ Define (Function, "html", class {
194
193
  });
195
194
 
196
195
  Define (Function.html, "template", function () {});
197
- Define (Function.html.template, "default", [
198
- "<div>",
199
- " <p>hello world</p>",
200
- "</div>",
201
- ]);
202
- Define (Function.html.template, "test", function () {
203
- var markup = new Function.markup (`
204
- <div>
205
- <p>hello</p>
206
- </div>
207
- `);
208
- return markup.render ();
196
+ Define (Function.html.template, "default", function (data = {}) {
197
+ var markup = [];
198
+ markup.push (`<div id="app">`);
199
+ markup.push (` <div application>`);
200
+ for (var i in data.heading) {
201
+ var n = parseInt (i) + 1;
202
+ markup.push (` <h${n}>${data.heading [i]}</h${n}>`);
203
+ }
204
+ markup.push (` <date>${data.date}</date>`);
205
+ markup.push (` <p>${data.description}</p>`);
206
+ markup.push (` </div>`);
207
+ markup.push (`</div>`);
208
+ return Function.markup.render (markup);
209
209
  });
210
210
 
211
211
  Define (Function.html, "head", class {
@@ -268,13 +268,3 @@ Symbol.export.html = Function.html;
268
268
  *
269
269
  * xxx://xxx.xxx.xxx/xxx
270
270
  */
271
-
272
- /*
273
- <script type="application/ld+json">
274
- {"@context": "https://schema.org", "@type": "WebPage", "name": "{{ site:name }}", "alternateName": "{{ site:alternate-name }}", "description": "{{ meta:description }}", "url": "{{ canonical }}"}
275
- </script>
276
-
277
- <script type="application/ld+json">
278
- {"@context": "https://schema.org/", "@graph": [{"@type": "website", "@id": "{{ canonical }}", "name": "{{ site:name }}", "url": "{{ canonical }}", "description": ""{{ meta:description }}}]}
279
- </script>
280
- */
@@ -554,8 +554,31 @@ Define (Function.hash, "require", function () { Function.hash.crypto.api = requi
554
554
  Define (Function.hash, "crypto", function () {});
555
555
  Define (Function.hash, "md5", function (input) { return Function.hash.crypto.api.createHash ("md5").update (input).digest ("hex"); });
556
556
 
557
+ Define (Function, "unique", function () {});
558
+ Define (Function.unique, "shuffle", function () { return String.char.alpha.numeric.repeat (16).shuffle ().substr (0, 64); });
559
+ Define (Function.unique, "id", function () {
560
+ return ("xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx").replace (/[xy]/g, function (c) {
561
+ const r = (Math.random () * 16) | 0;
562
+ const v = c === "x" ? r : (r & 0x3) | 0x8;
563
+ return v.toString (16);
564
+ });
565
+ });
566
+
557
567
  /**
558
- * xxx
568
+ * mongo
569
+ *
570
+ * title
571
+ * description
572
+ * sub description
573
+ *
574
+ * xxx://xxx.xxx.xxx/xxx
575
+ */
576
+
577
+ Define (Function, "mongo", function () {});
578
+ Define (Function.mongo, "require", function () { return Function.mongo.api = require ("mongodb"); });
579
+
580
+ /**
581
+ * socket.io
559
582
  *
560
583
  * title
561
584
  * description
@@ -564,6 +587,9 @@ Define (Function.hash, "md5", function (input) { return Function.hash.crypto.api
564
587
  * xxx://xxx.xxx.xxx/xxx
565
588
  */
566
589
 
590
+ Define (Function, "socket", function () {});
591
+ Define (Function.socket, "require", function () { return Function.socket.api = require ("socket.io"); });
592
+
567
593
  /**
568
594
  * 3rd party
569
595
  *
@@ -595,16 +621,6 @@ Define (Function.help, "argument", function () {
595
621
  return result;
596
622
  });
597
623
 
598
- Define (Function, "unique", function () {});
599
- Define (Function.unique, "shuffle", function () { return String.char.alpha.numeric.repeat (16).shuffle ().substr (0, 64); });
600
- Define (Function.unique, "id", function () {
601
- return ("xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx").replace (/[xy]/g, function (c) {
602
- const r = (Math.random () * 16) | 0;
603
- const v = c === "x" ? r : (r & 0x3) | 0x8;
604
- return v.toString (16);
605
- });
606
- });
607
-
608
624
  Function.ajax = function () {}
609
625
 
610
626
  Function.ajax.get = function (url, context) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "script.io.js",
3
3
  "description": "Hello World",
4
- "version": "2026.126.106",
4
+ "version": "2026.126.2039",
5
5
  "author": "Seindi Rahmat Barus <xseindi@gmail.com>",
6
6
  "contributors": [
7
7
  "Seindi Rahmat Barus <xseindi@gmail.com>"