{"id":"marvmax/shared-modules","name":"shared-modules","scope":"marvmax","platform":"roblox","description":"Reusable Luau libraries for Roblox games (DataManager player data persistence).","version":"0.1.0","latest":"0.1.0","versions":["0.1.0"],"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":"241bd55f31d27ec33c8c840347256a0e96708c6ed97c3045af27dda7f66ce42f","likes":0,"downloads":0,"install":"forest install marvmax/shared-modules","url":"https://forest.dev/p/roblox/marvmax/shared-modules","files":"https://api.forest.dev/ai/package/roblox/marvmax/shared-modules/files","readme":"# Roblox Shared Modules\n\nReusable Luau libraries for Roblox games.\n\n## Modules\n\n### `DataManager.luau`\nGeneric, configurable player data persistence layer for Roblox using DataStoreService.\n\n#### Features\n- **Configurable Schema**: Define default stats, types, and values in one table.\n- **Automatic Leaderstats**: Automatically mirrors specified stats to the player `leaderstats` folder.\n- **Auto-Saving**: Background loop automatically saves all players at configurable intervals.\n- **Graceful Shutdown**: Automatically connects to `BindToClose` and `PlayerRemoving` to prevent data loss.\n- **Studio-Safe**: Gracefully handles Studio environments where DataStore API access might be disabled.\n- **Strict Luau**: Fully typed with `--!strict`.\n\n#### Usage Example\n```luau\n--!strict\nlocal DataManager = require(game:GetService(\"ServerScriptService\").SharedModules.DataManager)\n\nlocal PlayerData = DataManager.new({\n    dataStoreName = \"PlayerData_v1\",\n    autoSaveInterval = 120,\n    resetOnJoin = false,\n    defaultData = {\n        Gems = 0,\n        Stage = 1,\n        Inventory = {},\n    },\n    leaderstats = {\n        Gems = \"IntValue\",\n        Stage = \"IntValue\",\n    },\n})\n\nPlayerData.init()\n\nreturn PlayerData\n```\n","readmeTruncated":false}