fixes obsolete documentations about the JS backend (#24263)

ref https://github.com/nim-lang/Nim/pull/21849
ref https://github.com/nim-lang/Nim/pull/21613
This commit is contained in:
ringabout
2024-10-08 22:40:18 +08:00
committed by GitHub
parent d72b848d17
commit f73e03b132

View File

@@ -87,20 +87,19 @@ available. This includes:
* OS-specific operations
* threading, coroutines
* some modules of the standard library
* proper 64-bit integer arithmetic
To compensate, the standard library has modules [catered to the JS backend](
lib.html#pure-libraries-modules-for-js-backend)
lib.html#pure-libraries-modules-for-the-javascript-backend)
and more support will come in the future (for instance, Node.js bindings
to get OS info).
To compile a Nim module into a ``.js`` file use the `js`:option: command; the
default is a ``.js`` file that is supposed to be referenced in an ``.html``
file. However, you can also run the code with `nodejs`:idx:
(http://nodejs.org):
(https://nodejs.org):
```cmd
nim js -d:nodejs -r examples/hallo.nim
nim js -r examples/hallo.nim
```
If you experience errors saying that `globalThis` is not defined, be