Hi Kurt Apologies for the delayed response.
On Fri, May 8, 2015 at 12:22 AM, Kurt Kincaid <[email protected]> wrote: > I am working on an encryption project with TW where I need to leverage an > additional node.js core module (*crypto*, in this case) and a non-core > module (*node-forge*). I read the thread where Jeremy mentioned that the > easiest way to include other node modules is to wrap them as a plugin. Make > perfect sense, and I suspect works in almost all cases. In my case, though, > I do not think this will work. First, with *crypto*, since it is a core > module, I cannot easily wrap it as a TW plugin. Second, in the case of > *node-forge*, it is actually comprised of numerous Javascript files, some > of which are fairly large (~ 130K). > > My question is this: is there another way to include additional node > modules without wrapping them as a plugin? I do not want to modify boot.js > since that will make upgrading problematic. > Under Node.js, if the target of a require() call doesn't exist as a tiddler, then the call is passed down to Node.js. So you should be able to just do `require("crypto")` to use the crypto library (as long as you don't have a tiddler called "crypto"). For the non-core module you'll need to use npm to install it but then you can use require in the same way. Best wishes Jeremy. > > If anyone could point me in the right direction, I would really appreciate > it. > > Thanks!! > > Kurt > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/tiddlywikidev. > To view this discussion on the web visit > https://groups.google.com/d/msgid/tiddlywikidev/279bebc3-18be-4ce6-ab63-f6f6852e11f5%40googlegroups.com > <https://groups.google.com/d/msgid/tiddlywikidev/279bebc3-18be-4ce6-ab63-f6f6852e11f5%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Jeremy Ruston mailto:[email protected] -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/tiddlywikidev. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/CAPKKYJZBJ003va7%2BUJjmiVBfVV1OWR%2B_8JDsgiZPQ%3DONxE%2BPxg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
