{"id":"ptekspy/maid","name":"maid","scope":"ptekspy","platform":"roblox","description":"Maid","version":"1.0.1","latest":"1.0.1","versions":["1.0.1"],"license":"Apache-2.0","licenseRating":"safe","licenseCaveats":["Modified files must carry a notice of changes. If the package ships a NOTICE file, its attributions must be preserved."],"licenseVerified":true,"dependencies":{},"integrity":"811d5a4bd5173b98215ff0093d1565fbecca90b86d951eb2e1279066e2bb2667","likes":0,"downloads":0,"install":"forest install ptekspy/maid","url":"https://forest.dev/p/roblox/ptekspy/maid","files":"https://api.forest.dev/ai/package/roblox/ptekspy/maid/files","readme":"# Maid\r\n\r\nA lightweight Luau cleanup manager for Roblox, inspired by common Maid-style patterns.\r\n\r\n## Features\r\n\r\n- Create a `Maid` instance with an optional lock key.\r\n- Add cleanup objects, functions, instances, and RBXScriptConnections.\r\n- Clean up all registered items in one call.\r\n- Optionally lock cleanup until `Unlock(key)` is called.\r\n\r\n## API\r\n\r\n```lua\r\nlocal Maid = require(path.to.Maid.init)\r\n```\r\n\r\n### Constructor\r\n\r\n```lua\r\nlocal maid = Maid.New()\r\nlocal lockedMaid = Maid.New(lockKey)\r\n```\r\n\r\n### Methods\r\n\r\n```lua\r\nmaid:IsActive() --> boolean\r\nmaid:Add(object) --> MaidToken\r\nmaid:Cleanup(...)\r\nmaid:Unlock(key)\r\n```\r\n\r\n### Usage example\r\n\r\n```lua\r\nlocal maid = Maid.New()\r\n\r\n-- Add cleanup actions\r\nmaid:Add(function()\r\n\tprint(\"cleaned up\")\r\nend)\r\n\r\n-- Add an instance or connection\r\nmaid:Add(part)\r\nmaid:Add(connection)\r\n\r\n-- Clean up everything later\r\nmaid:Cleanup()\r\n```\r\n\r\n### Token cleanup\r\n\r\nThe returned token can be destroyed manually to remove the item from the maid before cleanup:\r\n\r\n```lua\r\nlocal token = maid:Add(part)\r\ntoken:Destroy()\r\n```\r\n\r\n## Building\r\n\r\nUse `argon build` from the repository root to package the module.\r\n\r\n## Installation\r\n\r\nInstall with Wally if you use it in your project:\r\n\r\n```bash\r\nwally add ptekspy/Maid\r\n```\r\n","readmeTruncated":false}