2.2.0 • Published 8 years ago

node-resolve-lua v2.2.0

Weekly downloads
1
License
MIT
Repository
-
Last release
8 years ago

node-resolve-lua

npm npm

Implements node's require.resolve module resolution pattern for Lua.

This allows you to install Lua packages from npm and require them like normal modules.

All of the features of npm will come with using this pattern.

  • Semantic Versioning of modules
  • Modules installed locally, not globally
  • Manage installed modules in a package.json file
  • npm scripts
  • Tons more

Usage

npm uses this pattern when it installs modules. So let's use npm! installing npm

In your project directory, we need to install node-resolve-lua:

$ npm install node-resolve-lua
--Only needs to be done once
require("./node_modules/node-resolve-lua/node-resolve")

And that's it! You're ready to include modules from npm now.

Example Usage

If we wanted to use a module from npm such as luadash, we would do this:

$ npm install luadash
local __ = require("luadash")

function double (value)
  return value * 2
end

__.map(double, {1, 2, 3}) -- => {2, 4, 6}
2.2.0

8 years ago

2.1.0

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago