Node.js enquiry

Just a general query, how many of you are running TW on Node.js and how many as standalone? Advantages and disadavantages of either? And how to build the TW, as standalone followed by conversion of directly under Node.js?

I recently came across the Node.js documentation and am intrigued.

bobj

I use TiddlyServer, which is a node.js server, but I’m using it to serve up a bunch of standalone wikis and a single node-style wiki with a tiddlers folder.

I don’t understand the question, sorry.

Use create-tw-apps to create your new tiddlywiki application fastly Maybe you can look at this

@CodaCoder , the question was seeking info on how to create and build a TW if running on Node.js. For example, as a free standing TW, I just click the + sign to create new tiddlers, type special text to link, create filters, etc. Does this change under Node.js?

Also, what are the advantages/dis advantages of running under Node.js?

Maybe even ask the question, why use Node.JS at all?

bobj

@oeyoews , so what you are linking to is an easier way to create the TW app in the first place?

bobj

TidGi-Desktop is nodejs server, but can start with one click, no terminal black window, and can start on login.

Regarding the reasons to use the Node.js mode in the first place, I see 3 main advantages:

  1. Almost instantaneous sync of any modifications with the server counterparts even when the wiki is several dozens of megabytes
    1.1. Bandwith saved, as a corollary of the above
  2. Ability to commit any change at the tiddler granularity to whatever version control system you are using
  3. Ability to work on the same wiki simultaneously with several people (or several versions of yourself), provided that they don’t edit the same tiddler at the same time

Using Node is a part of my day job, so for me there’s no learning curve. I find several advantages:

  • Saving. I don’t forget to save on Node, as it happens automatically. I’d like to think I’m great about saving, but I’ve been working frenetically on a wiki for the past two weeks, and Friday night, when I emailed a version from one devise to another, I took the shortcut of not importing the results into my Node version and just working on those last-minute changes that creep up. I went to bed late, feeling happy with my work, only to find on Saturday morning that I’d lost it into the ether. I assume that I hadn’t saved it but then reloaded the file when I looked at it again. I had to redo three hours of work. That’s not happened to me when using Node.

  • Small files. I tend to store any important wiki in Git: often on GitHub, sometimes in GitLab, occasionally just in a local git repo. Git was designed for source code files. They tend to be several orders of magnitude smaller than the smallest Tiddlywikis. Git makes it easy to try different things, and choose to keep these attempts independent or to merge parts of them. To do this appropriately, it’s much easer with Node’s multiple-file mechanism…

  • Shared editing: Several of my wikis at work are for software documentation. The Node version, especially with Git behind it, makes collaboration much easier. There’s a lot more that could be done with this, and I have some hopes that the multi-wiki server version will improve it, but it’s already much easier than working with single-file wikis.

2 Likes

Extra benefit about node.js.

  • REST API is very powerful with node.js. I have used to external scripts for batch processing to literature information.
  • Performance of big TW with lazy load. My TW is about 10 K tiddlers, 10 GB in paces (with lots of images, documents, videos, etc). Lazy-load is very efficient here to improve loading time of large tiddlers to store data. Images, documents and video can be easily stored under files folder under node.js.
1 Like

There are MANY advantages of TW on nodejs, to the point I would never run a standalone TW again.

1) ACCESS:
My TW is accessible behind a login on my server from any device, anywhere, anytime. I can borrow a friends phone, laptop, or even a library computer and add entries anytime I want no matter where I am and if I left my devices at home. No software required, just a browser.

2) REST API:
I quite often make tiddlers from my phone by voice. I use a combination of Tasker on my Android phone and Node-red on my server to generate tiddlers from voice to text. I have a quick toggle button on my Android that opens the Google voice listener and I start talking and it converts my voice to text, sends it over to node-red which then injects a tiddler into my nodejs Tiddlywiki, so I post notes or journal entries from my car or a restaurant on the fly and it is already in my tiddlywiki when I get home.

3) BACKUP
I run gitea servers (hosting my own git repositories like GitHub, but private on my own servers). I have 2 servers in Colorado and 1 in Florida in my homes where I travel back and forth from for redundancy, and every 6 hours my tiddlers, which are single text files with nodejs are backed up via automated git commits to all 3 of my gitea servers, so all my data is secure and redundant.

I could go on, as there are many more benefits to running on nodejs. Like others, I have TONS of images, hundreds and hundreds, as well as PDF documents, etc, and the load time on my server is instantaneous, using lazy-loading, so it is fast, reliable, stable and always accessible.

1 Like

Thank you everybody for your comments. You have given me much to think about.

Is there a trial server that I could use to have a play around with before I make a decision either way?

Bobj

Just download https://tidgi.fun

In fact, you won’t feel any difference if you just open a nodejs tiddlywiki page.

I like to used tiddlywikis as subject notebooks and often have a number loaded into the browser at any one time, switching between them to add notes for different subject, and this cannot be done with the standard nodejs setup.

The nodejs setup has tiddlers as files, but I do no have a use for these files individually. However I have written and maintain a large number of plugins and in this case I develop them using nodejs wikis as I want to edit the javascript files(tiddlers) in a code editor and store them on github.

Although I use nodejs on my day-to-day computer I do not use npm due to security concerns with installing unknown packages (not a problem in the case of the standard tiddlywiki), I simply checkout tiddlywiki from github.


For anyone who wants to experiment with the tiddlywiki nodejs version, stackblitz is a good idea

my personal tiddlywiki nodejs project on stackblitz

I do something similar. I simply have my regular ones running as services on different ports, and any short-lived ones running on additional ports in terminal windows. At the moment, I have eight such services running on my work Windows machine; at home I probably have four or five each on my Ubuntu and Windows partitions.

Some of those wikis I use many times per day, others only once or twice per month. Individually and collectively, they don’t seem to cause any system slowdowns. I use NSSM in Windows and systemd on Ubuntu to create/manage the services.

I manage git commits independently. That is where I would love to see an expansion. I would love to find a way to automate git commits from the wiki: on command, on a specified cadence, or during a period of quiescence after some activity. For shared wikis, I would also like to automate regular pulls and tagging/versioning, controlled from inside the wiki, although that is a much lower priority.

I use tw on node.js almost exclusively. I use it with podman because it simplfies things a lot for me (I’m on linux only). I have done a small bash script to help out, which I have completed by a Makefile to help iteven further, which allos me to create new wikis very easy.

Node.js allows me t store my tiddlers in the filesystem as individual files (ywo files most of the times, really) and I can then use a tool like git if I want a more robust history (that’s mostly for tw applications I am building, but I have also done it for user tiddlers). I nevertheless use daily archives of my tiddlers in parallel. that’s easy and an other security. Also, the voume is quite less than that of a full onefile tw which is also cumbersome as to figure out what tiddler the are inside it.

If I finally get to be able to use a stateless linux like nixos, I could ditch podman in the future.