{"id":"prophetouw/cleanit","name":"cleanit","scope":"prophetouw","platform":"roblox","description":"A memory cleaning helper.","version":"2.0.4","latest":"2.0.4","versions":["1.0.0","1.0.1","1.0.2","1.0.3","1.0.5","1.0.6","1.0.7","1.0.8","1.1.0","1.1.1","1.1.2","1.1.3","1.1.4","1.1.5","1.2.0","1.2.1","1.2.2","1.2.3","1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","1.3.5","1.3.6","1.3.7","1.3.8","1.3.9","1.3.10","1.3.11","1.3.12","1.3.13","1.3.14","1.3.15","1.3.16","1.3.17","1.3.18","1.3.19","1.3.20","1.4.0","1.5.0","2.0.0","2.0.1","2.0.2","2.0.3","2.0.4"],"license":"MIT","licenseRating":"safe","licenseCaveats":["The package archive does not include its license text; the license is declared in its manifest metadata."],"licenseVerified":false,"dependencies":{},"integrity":"d79a3d415473ef38c45e905ec8d48472402e227ae88fc41ad5e7a6df58f689d3","likes":0,"downloads":0,"install":"forest install prophetouw/cleanit","url":"https://forest.dev/p/roblox/prophetouw/cleanit","files":"https://api.forest.dev/ai/package/roblox/prophetouw/cleanit/files","readme":"# CleanIt\r\nA LUAU memory cleaner, it's a simple package that helps you clean memory. As of now, CleanIt has cleaning support for: \r\n- Functions\r\n- Instances\r\n- Connections\r\n- Threads\r\n- Tables\r\n- Anything with a Destroy function\r\n> [!CAUTION]\r\n> If you are sending in functions or objects with custom destroy functions, make sure there is error handling in those functions. **All** yields in any destroy functions will effect all of the other elements in the CleanIt cleaning list.\r\n## Installation\r\n### Roblox\r\nhttps://create.roblox.com/store/asset/87184763787563/CleanIt\r\n### Wally\r\n```\r\nCleanIt = \"prophetouw/cleanit@1.3.13\"\r\n```\r\n### Github\r\nTo download this from the github, see the [releases](https://github.com/ProphetOuw/CleanIt/releases/tag/first) section and download the latest rbxm file.\r\n## Methods\r\n### Timed cleaning\r\n```lua\r\nCleanIt.Delay(Entity,.2)\r\n```\r\n### Add\r\nAdds the Entity to the cleaning list.\r\n```lua\r\nlocal Cleaner = CleanIt.New()\r\nCleaner:Add(object1)\r\nCleaner:Destroy()\r\n```\r\nIf you want custom cleaning logic you can use functions:\r\n```lua\r\nlocal Object = workspace.Object\r\nCleaner:Add(function()\r\n    task.spawn(function()\r\n        Object.Name = \"--\";\r\n        task.wait(1)\r\n        Object:Destroy()\r\n    end)\r\nend)\r\ntask.wait(.5)\r\nCleaner:Destroy() -- deletes the thread before it gets to the point of deleting the object\r\nPrint(Object.Parent.Name)\r\n```\r\n### Clean\r\nIf you want to empty the cleaner without deleting it\r\n```lua\r\nCleaner:Clean()\r\n```\r\n### Connect\r\nFor signals\r\n```lua\r\nCleaner:Connect(Workspace.ChildAdded,function(child)\r\n    print(child.Name)\r\nend)\r\n```\r\n### Remove\r\nRemoves the entity's reference from the cleaner's cleaning list. This function is useful for garbage collection.\r\n```lua\r\nlocal Object = {\r\n    Name = \"Hi\"\r\n    Run = function()\r\n\r\n    end\r\n}\r\nfunction Object:Destroy()\r\n    Cleaner:Remove(self) -- remove reference so garbage collector can clean the memory\r\n    for k in pairs(self) do\r\n        self[k] = nil;\r\n    end\r\nend\r\nCleaner:Add(Object)\r\nreturn Object\r\n```\r\n### Destroy\r\nCleans everything in the CleanIt cleaning list and itself.\r\n```lua\r\nCleaner:Add(object1)\r\nCleaner:Destroy()\r\n```","readmeBorrowedFrom":{"version":"1.3.13","source":"wally"},"readmeTruncated":false}