Hook to js file

121 views
Skip to first unread message

Carlo Alberto Catarinicchia

unread,
Oct 18, 2013, 10:55:41 AM10/18/13
to no...@googlegroups.com
Hello,

is it possible from the nools file to call functions declared on the js file? 
I mean I create my nools file, that get compiled from my js file. In one of my rhs of a rule, the then, from the nools file, I need to use a function declared in the js file, in my case send to tweet, how can I do that?

I have seen that the import command works only for nools file, is there something similar to require that I can use?

Carlo

Douglas Martin

unread,
Oct 18, 2013, 11:00:35 AM10/18/13
to no...@googlegroups.com
So there are a couple of ways of doing this you can use the scope option to provide functions you want available to your rules file or you can use the global to require a JS file (the global require will only work on the server).

Carlo Alberto Catarinicchia

unread,
Oct 18, 2013, 3:20:47 PM10/18/13
to no...@googlegroups.com
And it was there right on plain sight on the readme. On the first read I misunderstood the use of scope.

Thanks Doug.

Carlo
Reply all
Reply to author
Forward
0 new messages