This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Dividing project into modules in deamon directory
#1
Hello,

is it possible to divide project in deamon directory and then require("./script1") like in NodeJS?
Done is better than perfect
Reply
#2
You can either place libraries/code parts in store/libs directory, then you can load them the via:
Code:
require('applibs.mylib') -- custom.mylib for older versions

Or you can place them together with daemon but then you will need to specify full path. Use this short wrapper function:
Code:
function loadlib(path)
  return dofile('/data/apps/store/daemon/' .. path .. '.lua')
end

loadlib('myapp/mylib')
Reply
#3
ThanksWink
Done is better than perfect
Reply


Forum Jump: