Thank you for pointing out the filesystem adaptor Danielo, I've had a look at it and can see that in the TiddlyWiki core code it checks for modules of type 'syncadaptor' and uses the exported methods there, so the JS in filesystem is executed server side from within the core.
I can see also that code in my JS macro is executed once at startup in a node context without failures, but then when calling the as a macro from the browser the same JS code fails due to node-specific things like 'require' (as well as CORS restrictions on the request to Pinboard). I'm unsure as to how I should write my plugin so that my JS code can be executed in a node context rather than a browser context. I'm looking at the other module types <http://tiddlywiki.com/static/ModuleType.html> wondering if perhaps one of those will allow my plugin modules to be triggered from the open TiddlyWiki in the browser but still executed server side where they are not subject to CORS. Thank you for your help so far, Dan On Thursday, 18 August 2016 18:49:25 UTC+1, Danielo Rodríguez wrote: > > > > El jueves, 18 de agosto de 2016, 19:40:54 (UTC+2), Daniel Metcalfe > escribió: >> >> Thanks Danielo, >> > You're welcome > > >> >> My main concern is if there is a way to do it using TiddlyWiki plugin >> mechanism though? From the examples I've seen things you can add via >> plugins just run within the browser once you've loaded a TiddlyWiki. >> > > That is not exactly true. If you plan to run your TW in node, part of your > plugin can run just on the browser and part of your plugin can run just on > node. That way you can create some client-server architecture within your > plugin. The only restriction for the people wanting to use it is that they > would have to run your plugin in a node TW. > > >> >> I'd like it to be easily shareable like you suggested, if I have to >> modify TiddlyWiki core code then it is not very shareable, people will have >> to deploy my fork of the repo. >> > > As I said, TW has the ability to run code on the browser, the server or > both. The filesystem adaptor is an example of it. > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/1db4abcf-9764-4d79-9db8-b1c1c90c8470%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

