Knowing when invocations of tiddlywiki in nodejs complete.

23 views
Skip to first unread message

Matthew Lauber

unread,
Dec 1, 2016, 2:30:00 PM12/1/16
to TiddlyWikiDev
All, I've been working on TiddlyServer, software for managing multiple wikis on your local box.  I've been using the tiddlywiki command line commands in various places, like so:
    var $tw = require("tiddlywiki/boot/bootprefix.js").bootprefix();
    delete $tw.browser;
    var server = require("tiddlywiki/boot/boot.js").TiddlyWiki($tw);
    server.boot.argv = ['/path/to/wikifolder, '--init', 'server']
    server.boot.boot();

Unfortunately, this way of invoking the command line functions isn't synchronous, and I don't know how to tell when it completes.  In this specific situation, I'm invoking rendertiddlers to try to extract the tiddlers from a wikifile into a wikifolder, before I start a server serving that wikifolder.  The extraction is working fine, after a bit of testing, but the server starts before the extraction completes, and thus doesn't pick up and handle the extracted files.  

I'm wondering if there's any way to tell when server.boot.boot() and all it's subtasks has completed?

Matt Lauber
Reply all
Reply to author
Forward
0 new messages