forked from luvit/luvit
-
Notifications
You must be signed in to change notification settings - Fork 0
node to luvit gotchas
radare edited this page Mar 13, 2012
·
2 revisions
While luvit has a similar api to node
here are things to look for when converting code.
- Arrays and Hashtables is a single variant type
table
- Arrays start at index 1
- The directory catalog
index.js
isinit.lua
-
path.exists
,path.existsSync
arefs.exists
,fs.existsSync
respectively -
global
is_G
- Object reference must be passed to methods explicitly or use ':' operator.
foo:bar()
instead offoo.bar(foo)
-
node_modules/
directory corresponds tomodules/
- The CommonJS
module
andexports
is not used. Simplyreturn
a value from a module:
-- equivalent to module.exports = {foo: bar}
return { foo = bar }