Forest Logo
search
package_2

janitor

By @cometahn1042f

Roblox

Mirrored

Janitor

Janitor is a high-performance memory management and object cleanup library for Luau on Roblox. It tracks instances, connections, functions, promises, and custom objects, ensuring deterministic destruction and preventing memory leaks.

Documentation Index

  • API Reference: Complete class definition, types, and method signatures.
  • Architecture & Design: System design, weak-key registry model, and trade-offs.
  • Performance & Memory Profile: Algorithmic complexity bounds and thread cleanup mechanics.
  • Failure Modes & Exception Guarantees: Exception safety, re-destroy suppression, and edge cases.
  • Executable Examples: Practical Luau usage patterns and code samples.

Quick Start

local Janitor = require(path.to.Janitor)
local janitor = Janitor.new()

-- Track a connection
janitor:Add(workspace.ChildAdded:Connect(print), "Disconnect")

-- Track an Instance
local part = Instance.new("Part")
janitor:Add(part, "Destroy")

-- Clean up everything
janitor:Cleanup()

Package Details

Install command (Click to copy)


Version

0.1.6

License

MIT

check_circle

Safe for commercial use

Automated license review — not legal advice.