https://github.com/theypsilon/lua-import
library for importing dependencies with a more terse syntax
https://github.com/theypsilon/lua-import
Last synced: over 1 year ago
JSON representation
library for importing dependencies with a more terse syntax
- Host: GitHub
- URL: https://github.com/theypsilon/lua-import
- Owner: theypsilon
- Created: 2015-01-11T14:25:27.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2019-10-02T19:44:36.000Z (over 6 years ago)
- Last Synced: 2025-02-01T11:30:18.660Z (over 1 year ago)
- Language: Lua
- Homepage:
- Size: 1000 Bytes
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lua-import
Library for importing dependencies with a more terse syntax
## Import usage
On top of your file:
```lua
local Layer, Graphics, Data; import()
```
This code is equivalent to:
```lua
local Layer = require('Layer')
local Graphics = require('Graphics')
local Data = require('Data')
```
Additionally, you can also provide a path on the import, so it will be used in all the requires:
```lua
local Layer, Graphics, Data; import('lib/')
```
Does same as:
```lua
local Layer = require('lib/Layer')
local Graphics = require('lib/Graphics')
local Data = require('lib/Data')
```