Skip to content

node to luvit gotchas

Robert Chiniquy edited this page Feb 24, 2015 · 4 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 is init.lua
  • path.exists, path.existsSync are fs.exists, fs.existsSync respectively
  • global is _G
  • Object reference must be passed to methods explicitly or use ':' operator. foo:bar() instead of foo.bar(foo)
  • node_modules/ directory corresponds to modules/
You can’t perform that action at this time.