You can install Janitor in Roblox Studio using a script executed in the Command Bar. This method uses HttpService to fetch the source files from GitHub and reconstruct the module structure in ReplicatedStorage.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local HttpService = game:GetService("HttpService")
local HttpEnabled = HttpService.HttpEnabled
HttpService.HttpEnabled = true
local function RequestAsync(RequestDictionary)
return HttpService:RequestAsync(RequestDictionary)
end
local function GetAsync(Url, Headers)
Headers["cache-control"] = "no-cache"
local Success, ResponseDictionary = pcall(RequestAsync, {
Headers = Headers;
Method = "GET";
Url = Url;
})
if Success then
if ResponseDictionary.Success then
return ResponseDictionary.Body
else
return false, string.format("HTTP %*: %*", ResponseDictionary.StatusCode, ResponseDictionary.StatusMessage)
end
else
return false, ResponseDictionary
end
end
local function Initify(Root)
local InitFile = Root:FindFirstChild("init")
or Root:FindFirstChild("init.luau") or Root:FindFirstChild("init.client.luau") or Root:FindFirstChild("init.server.luau")
or Root:FindFirstChild("init.luau") or Root:FindFirstChild("init.client.luau") or Root:FindFirstChild("init.server.lua")
if InitFile then
InitFile.Name = Root.Name
InitFile.Parent = Root.Parent
for _, Child in Root:GetChildren() do
Child.Parent = InitFile
end
Root:Destroy()
Root = InitFile
end
for _, Child in Root:GetChildren() do
Initify(Child)
end
return Root
end
local FilesList = HttpService:JSONDecode(assert(GetAsync(
"https://api.github.com/repos/howmanysmall/Janitor/contents/src",
{accept = "application/vnd.github.v3+json"}
)))
local Janitor = Instance.new("Folder")
Janitor.Name = "Janitor"
for _, FileData in FilesList do
local ModuleScript = Instance.new("ModuleScript")
ModuleScript.Name = tostring(string.match(FileData.name, "(%w+)%.luau?"))
local Success, Source = GetAsync(FileData.download_url, {})
if not Success then
ModuleScript.Source = string.format("-- %*", tostring(Source))
else
ModuleScript.Source = tostring(Success)
end
ModuleScript.Parent = Janitor
end
Janitor.Parent = ReplicatedStorage
Initify(Janitor)
HttpService.HttpEnabled = HttpEnabled