prototype.exe 0.0.1 → 0.0.2

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/package.js CHANGED
@@ -0,0 +1 @@
1
+ module.exports = exports = Symbol.export;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "prototype.exe",
3
3
  "description": "JScript",
4
- "version": "0.0.1",
4
+ "version": "0.0.2",
5
5
  "main": "src/prototype.js",
6
6
  "files": [
7
7
  "src/",
package/src/prototype.js CHANGED
@@ -638,10 +638,12 @@ Function.cookie.data = {}
638
638
  */
639
639
 
640
640
  Define (Function, "path", function () {});
641
- Define (Function.path, "require", function () { return Function.path.api = require ("node:path"); });
641
+ Define (Function.path, "require", function (api) { return Function.path.api = api; });
642
642
  Define (Function.path, "join", function (... path) { return Function.path.api.join (... path); });
643
643
  Define (Function.path, "exist", function (... path) { return Function.file.api.existsSync (Function.path.api.join (... path)); });
644
644
  Define (Function.path, "current", function (path) { return "./" + path; });
645
+ Define (Function.path, "io", function (io) { if (Array.isArray (io)) Function.path.io.value = io; else return Function.path.io.value.includes (io); });
646
+ Function.path.io ([]);
645
647
 
646
648
  /**
647
649
  * file
@@ -654,8 +656,8 @@ Define (Function.path, "current", function (path) { return "./" + path; });
654
656
  */
655
657
 
656
658
  Define (Function, "file", function () {});
657
- Define (Function.file, "require", function () { return Function.file.api = require ("node:fs"); });
658
- Define (Function.file, "write", function (file, data, context) { if (context) return Function.file.api.writeFile (file, data, context); else return Function.file.api.writeFileSync (file, data); });
659
+ Define (Function.file, "require", function (api) { return Function.file.api = api; });
660
+ Define (Function.file, "write", function (file, data, context) { if (Function.path.io ("write") === false) return null; if (context) return Function.file.api.writeFile (file, data, context); else return Function.file.api.writeFileSync (file, data); });
659
661
  Define (Function.file, "read", function (file, context) { if (context) return Function.file.api.readFile (file, context); else return Function.file.api.readFileSync (file); });
660
662
  Define (Function.file, "exist", function (file) { return Function.file.api.lstatSync (file).isFile (); });
661
663
  Define (Function.file, "extension", {text: ".txt", json: ".json"});
@@ -674,7 +676,7 @@ Define (Function.dir, "exist", function (dir) { return Function.file.api.lstatSy
674
676
  */
675
677
 
676
678
  Define (Function, "hash", function () {});
677
- Define (Function.hash, "require", function () { Function.hash.crypto.api = require ("node:crypto"); });
679
+ Define (Function.hash, "require", function (api) { Function.hash.crypto.api = api; });
678
680
  Define (Function.hash, "crypto", function () {});
679
681
  Define (Function.hash, "md5", function (input) { return Function.hash.crypto.api.createHash ("md5").update (input).digest ("hex"); });
680
682
  Define (Function.hash, "sha1", function (input) { return Function.hash.crypto.api.createHash ("sha1").update (input).digest ("hex"); });
@@ -702,7 +704,7 @@ Define (Function.unique, "id", function () {
702
704
  */
703
705
 
704
706
  Define (Function, "http", function () {});
705
- Define (Function.http, "require", function () { return Function.http.api = require ("node:http"); });
707
+ Define (Function.http, "require", function (api) { return Function.http.api = api; });
706
708
 
707
709
  /**
708
710
  * socket.io
@@ -715,7 +717,7 @@ Define (Function.http, "require", function () { return Function.http.api = requi
715
717
  */
716
718
 
717
719
  Define (Function, "socket", function () {});
718
- Define (Function.socket, "require", function () { return Function.socket.api = require ("socket.io"); });
720
+ Define (Function.socket, "require", function (api) { return Function.socket.api = api; });
719
721
  Define (Function.socket, "io", class {});
720
722
  Define (Function.socket, "server", function (app, option = {}) {
721
723
  var server = Function.http.api.createServer (app);
@@ -1313,7 +1315,7 @@ Symbol.export = {
1313
1315
  object: Object, array: Array, string: String, number: Number, function: Function,
1314
1316
  date: Date, time: Date.time, timeout: Date.timeout, datetime: new Date.io,
1315
1317
  event: Event, promise: Promise,
1316
- url: URL, path: Function.path, file: Function.file, dir: Function.dir,
1318
+ url: URL, path: Function.path, file: Function.file, dir: Function.dir, http: Function.http,
1317
1319
  db: Function.db, database: Function.database,
1318
1320
  cookie: Function.cookie, session: Function.session, ls: Function.ls,
1319
1321
  markup: Function.markup, html: Function.html, css: Function.css, js: Function.js, json: JSON, xml: Function.xml, serialize: Function.serialize,
@@ -1330,10 +1332,10 @@ Symbol.export = {
1330
1332
  zero: 0, one: 1,
1331
1333
  }
1332
1334
 
1333
- var JScript = Symbol.export;
1334
-
1335
1335
  /**
1336
1336
  * the end
1337
1337
  *
1338
1338
  * xxx://xxx.xxx.xxx/xxx
1339
1339
  */
1340
+
1341
+ // module.exports = exports = Symbol.export;