@naanlang/naan 1.4.4 → 1.5.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.
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
- **NaaN for NPM** version **1.4.4+1** is released under the MIT License:
1
+ **NaaN for NPM** version **1.5.0+1** is released under the MIT License:
2
2
 
3
- Copyright (c) 2017-2024 Zulch Laboratories, Inc.
3
+ Copyright (c) 2017-2025 Zulch Laboratories, Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -4,8 +4,8 @@
4
4
  NaaN is an async-first software platform for rapid development.
5
5
 
6
6
  #### Release:
7
-      **NaaN for NPM** version **1.4.4+1**
8
-      Copyright (c) 2017-2024 Zulch Laboratories, Inc.
7
+      **NaaN for NPM** version **1.5.0+1**
8
+      Copyright (c) 2017-2025 Zulch Laboratories, Inc.
9
9
 
10
10
  #### Features
11
11
  - **NaaN** runs in NodeJS and web browsers using JavaScript
@@ -23,7 +23,7 @@ NaaN is an async-first software platform for rapid development.
23
23
 
24
24
  #### Installation
25
25
 
26
- Please ensure you have a recent version of [node.js](http://nodejs.org/). The minimum is `v16.20.2`
26
+ Please ensure you have a recent version of [node.js](http://nodejs.org/). The minimum is `v20.10.0`
27
27
 
28
28
  For use everywhere as a command line app:
29
29
 
@@ -62,7 +62,7 @@ Define a function, call it, and return the length of the base-10 result. First r
62
62
  % naan -e "function factr(x,a){if x>0 factr(x-1,x*a) else a}(10000,1).length"
63
63
  35660
64
64
  ```
65
- Fetch your public IP from a website (NodeJS version 18 or later):
65
+ Fetch your public IP from a website:
66
66
 
67
67
  ```
68
68
  % naan -e "new(await(await((js.g||js.w).fetch('https://api.ipify.org/?format=json')).1.json()).1)"
package/bin/index.js CHANGED
@@ -26,6 +26,7 @@ var naanpath = path.join(__dirname, ".."); // p
26
26
  var rootpath = naanpath; // path to us, which is naan
27
27
  var envpath = jspath.resolve(naanpath, 'lib/env_node.js'); // path to Naan loader
28
28
 
29
+
29
30
  /*
30
31
  * Process command-line arguments
31
32
  *
@@ -68,11 +69,11 @@ process.argv.every((val, index) => {
68
69
  return (true);
69
70
  }
70
71
  if (val == "--version") {
71
- console.log("1.4.4");
72
+ console.log("1.5.0");
72
73
  process.exit(0);
73
74
  }
74
75
  if (val == "--buildno") {
75
- console.log("1.4.4+1");
76
+ console.log("1.5.0+1");
76
77
  process.exit(0);
77
78
  }
78
79
  if (val.substring(0,1) == "-") {
@@ -156,11 +157,28 @@ if (eval_text) {
156
157
  }
157
158
 
158
159
 
160
+ /*
161
+ * versionCheck
162
+ *
163
+ */
164
+
165
+ function versionCheck(minver) {
166
+ var rxver = /([0-9]+)[.]([0-9]+)[.]([0-9]+)/;
167
+ minver = minver.match(rxver).map(function(x){ return(Number.parseInt(x)) });
168
+ var curver = process.version.match(rxver).map(function(x){ return(Number.parseInt(x)) });
169
+ return (minver[1] < curver[1] || minver[1] == curver[1] && (minver[2] < curver[2] || minver[2] == curver[2] && minver[3] <= curver[3]));
170
+ }
171
+
172
+
159
173
  /*
160
174
  * Execute Naan
161
175
  *
162
176
  */
163
177
 
178
+ if (!versionCheck("v20.10.0")) {
179
+ console.log(`naan: nodejs ${ process.version } too old, requires v20.10.0 or newer`);
180
+ process.exit(1);
181
+ }
164
182
  var NaanNodeREPL = require(envpath);
165
183
  var naanrepl = new NaanNodeREPL(naanOptions);
166
184
  naanrepl.setDirectory(rootpath);
package/dist/env_web.js CHANGED
@@ -550,7 +550,7 @@ exports.NaanControllerWeb = function() {
550
550
  localStorage.removeItem("NaanState_Hosted");
551
551
  return (false);
552
552
  }
553
- if (querystrings["nosave"])
553
+ if ("nosave" in querystrings)
554
554
  return (false);
555
555
  var statedoc = makeState();
556
556
  var statestr = JSON.stringify(statedoc);
@@ -631,7 +631,7 @@ exports.NaanControllerWeb = function() {
631
631
  }
632
632
 
633
633
  /*jshint sub:true */
634
- if (querystrings["restart"] || !loadLocal())
634
+ if ("restart" in querystrings || !loadLocal())
635
635
  { // don't load state or can't load state
636
636
  naanlib.banner();
637
637
  var hostpath = window.location.origin.concat(naanlib.js.r("path").dirname(window.location.pathname));