Node.JS 20 and TiddlyWiki: Single Executable

I read from Node.JS 20 documentation that

Node 20 allows you to compile your app into a single executable along with the entire Node.js core so you can run your apps on systems where node isn’t installed, or your don’t trust the system version.

My question is: Can we have a tw.exe for Windows or similar for Linux/Mac?

2 Likes

I think the most important info is this: Single executable applications | Node.js v20.0.0 Documentation

At the moment the TW-server boot-process is “file-based”. So the tw code contains several if statements like:

if($tw.node) {
// do node stuff with "hardcoded" file access
}

or

if($tw.browser) {
	if(window.require) {
		// do browser based module handling
	}
} else {
	// If we don't have a module with that name, let node.js try to find it
	return require(moduleName);
}

and so on. … As far as I do understand the docs (which I don’t) we would need to create a very special node server version, which is bundled into 1 file, which can be “injected” into node.exe. …

So it’s probably much much more work, than it looks like. Creating a “Hello World” is simple, but useless.
-m

2 Likes

Hi @pmario
Thank you for clarification

I thought we may have something like TiddlyWikiDesktop but lighter and smaller in size!

Node.exe alone is 60MByte in size for windows.

1 Like

I think all that this would offer us is potentially simpler installs of tools like TiddlyWikiDesktop (which I have only barely touched; so it may not apply.) Essentially it would change instructions like:

  1. Download and install Node
  2. Download our application
  3. Step 3

Into ones like this:

  1. Download our application
  2. Step 2

There are times when that’s helpful, but it’s not a huge win.

1 Like

Perhaps another approach is already bob.exe as is or the feature “Bob saver server” that allows bob.exe to share single file wikis.

  • I could imagin a simplified node executable that simply provides the “Bob saver server”

This is a good idea. The more I research distributed networking, the more I realize that TW instances running under node should act as Clients. I understand why under the web2 model the node-server<->browser-client relationship was modeled that way. But with web3 concepts its more like node-client->distributed-network/WNFS<-browser-client, and now you can scale both sides up as nodes in a multiplayer network. Spin up a node client on your PC to do data processing & then call a LLM api & then inject the result of that as a tiddler in your wiki. The sync layer then auto-distrubutes that to all other clients (browser or node).