📦 Packages
Shard supports an official package repository that makes it easy to install and manage reusable modules directly to Visual Studio Code using the Shard plugin.
🚀 Installing a Package
If you don't have the Shard plugin installed, you can find it in the Visual Studio Marketplace.
-
Open the command palette via the Shard plugin:
Ctrl + Shift + P
(Windows/Linux) orCmd + Shift + P
(Mac).> Shard: Install Package
-
Enter the package name (e.g.,
DataValidator
,ShardMath
). -
The plugin will:
- Download the package from the repository
- Place or update it inside your
Packages
folder - Automatically reflect changes in VS Code
🧩 Benefits
- 🔄 One-command install & update
- 🧱 Modular: packages are cleanly separated in the
Packages/
folder - ✅ Versioned and maintained
- 💼 Collaboration Friendly: Anyone can make a pull request to the packages repository
📁 Package Folder Structure
All packages are installed into:
src/
shared/
Packages/
your-package-name/
ShardMath example of accesing installed packages and utilizng them:
local ShardMath = require(ReplicatedStorage.Packages.ShardMath)
local shardMath = ShardMath.new(1000000)
print(shardMath:formatWithSuffix()) -- 1M
print(shardMath:formatWithFullName()) -- 1 Million
-- // Singleton:
print(ShardMath.formatNumberWithSuffix(1000000)) -- 1M
print(ShardMath.formatNumberWithFullName(1000000)) -- 1 Million
-- // With decimal places:
print(ShardMath.formatNumberWithSuffix(1000000, 2)) -- 1.00M