$tw.boot.argv = ['myproject', '--listen'];
$tw.boot.boot();
console.log($tw.node);
// {}
console.log($tw.wiki.getTiddlerText('$:/info/node'));
// yes--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/3e0d6bc9-86c3-443c-8146-81acc7c98809%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Maybe it's basically a bad way of thinking, so I am reformatting the question: how can I use NPM modules in a widget?
--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/72c2fe2f-b746-4a2b-9d50-224b6e18ff4f%40googlegroups.com.
The sync mechanism seems to be usable, I go around the topic, thank you for the idea!PS.: According to your comment, if you would like GitLab saver to 5.1.20, please merge the request, otherwise mark it with "post-v5.1.20" just to give me some feedback. :)
--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/0a206645-1cfa-4de9-9563-f4b91dc43bf7%40googlegroups.com.
... have the browser create a tiddler with some flags that gets synced to the server. The serverside code picks up the tiddler (by searching for the same flags), and then performs some operation, putting the results back in the same tiddler.
// Start TiddlyWiki
var $tw = require('tiddlywiki').TiddlyWiki();
$tw.boot.argv = ['gui', '--listen'];
$tw.boot.boot(function() {});
$tw.wiki.addEventListener("change", function (changedTiddlers) {
if (!"$:/communicate-with-server" in changedTiddlers) return;
var tiddler = $tw.wiki.getTiddler("$:/communicate-with-server");
if (!tiddler || (tiddler.fields["sender"] === "server")) return;
console.log("Query got from browser");
var query = tiddler.fields.text;
var response = $tw.wiki.getModificationFields();
response["sender"] = "server";
// Parse query...
console.log("Original query:" + query);
response.text = query.toUpperCase();
$tw.wiki.addTiddler(new $tw.Tiddler(tiddler,response));
}); $tw.utils.nextTick(function() {
$tw.syncer.enqueueSyncTask({type: "load", title: "$:/communicate-with-server"})
});--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/030d5158-3cac-472c-8044-5c48284b40f1%40googlegroups.com.
To make the browser to pick up changes from the server then you can trigger polling with the tm-server-refresh message. In my own experiments I often just change the default polling interval from 60s down to 3-5s (via $:/config/SyncPollingInterval).
You may also be interested in this pending PR which attempts to address some of these issues by introducing a new framework for invoking external tasks on the server:
$ mkdir files
$ echo "Some text" > ./files/foo.txt
$ tiddlywiki --listen
To make the browser to pick up changes from the server then you can trigger polling with the tm-server-refresh message. In my own experiments I often just change the default polling interval from 60s down to 3-5s (via $:/config/SyncPollingInterval).I'm afraid something is wrong: I created a new wiki ("tiddlywiki --init server"), made a tiddler, changed the text on the file system and issued the $tw.rootWidget.dispatchEvent({type: "tm-server-refresh"}) command in the browser console, but the tiddler has not been updated.
PS.: $:/config/SyncPollingInterval could be documented at https://tiddlywiki.com/#Hidden%20Settings if you agree.
--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/0cd9d225-d507-4b24-abdd-98db0c0e9e4c%40googlegroups.com.

Yes, it should be documented there.
let UglifyJS = require("uglify-es") let fs = require("fs")