Reference

Global Functions

All global functions injected or extended by the Nodeal runtime.

Global Functions

The Nodeal virtualization layer injects a suite of global functions that provide intelligent dependency resolution, enhanced type checking, and advanced proxy manipulation.


import

The cornerstone of Nodeal. It resolves modules by their registered name, abstracting away the physical file hierarchy of your project.

Signature

import(moduleName: string): any

Parameters

NameTypeDescription
moduleNamestringThe unique name of the module assigned in the Nodeal Dashboard.
Tip

Path Independence: Because import uses a lookup table built by the Pre-Parser, you can move a module from ServerStorage to ReplicatedStorage without changing a single line of code in the scripts that import it.

Example

local InventoryService = import("InventoryService")
local PlayerData = InventoryService:Get(game.Players.LocalPlayer)

newproxy

While Luau provides a basic newproxy, Nodeal's version is significantly enhanced. It allows for the "wrapping" of existing objects (including Roblox Instances) to create secure, metatable-driven proxies.

Signature

newproxy(target: boolean | any): Userdata

Parameters

NameTypeDescription
targetboolean | anyIf true, creates a new empty proxy. If an object is passed, creates a proxy that wraps that specific object.
Important

Instance Wrapping: Using newproxy(Instance) allows you to create a "Virtual Instance" that can intercept property access and method calls before they hit the real engine object.

Example

-- Creating a secure wrapper for the Players service
local RealPlayers = game:GetService("Players")
local ProxyPlayers = newproxy(RealPlayers)
getmetatable(ProxyPlayers).__index = function(self, key)
print("Intercepted access to Players." .. key)
return RealPlayers[key]
end

typeof

Standard typeof is often insufficient for custom classes. Nodeal's version respects the __type metamethod, allowing your custom objects to participate in the native type system.

Signature

typeof(value: any): string

Returns

  • string: The value of metatable.__type if it exists; otherwise, the standard Luau type.

Example

local MyClass = {}
local instance = newproxy(true)
getmetatable(instance).__type = "MySpecialClass"
print(typeof(instance)) -- "MySpecialClass"

unpack

Enhanced to support unpacking Nodeal proxies and any object that implements the __unpack metamethod.

Signature

unpack(target: table | Userdata, start: number?, finish: number?): ...any
Note

This is particularly useful when working with custom Collection types or Proxy Wrappers where the underlying data structure isn't a standard table.

Example

local proxy = newproxy(true)
getmetatable(proxy).__unpack = function()
return "Nodeal", 2024, true
end
local a, b, c = unpack(proxy)
print(a) -- Nodeal