Hey Meteor Community,
I’m excited to share a new utility package that I created and we’ve been using in our projects: the Meteor Settings Validator.
What it does: This package simplifies Meteor.settings validation using a Zod schema, ensuring your settings adhere to the expected structure.
How to use:
- Installation:
meteor add hschmaiske:meteor-settings-validator
meteor npm i zod
- Usage:
import { MeteorSettingsValidator } from "hschmaiske:meteor-settings-validator";
const MeteorSettingsSchema = z.object({
public: z.object({
// Define your public settings structure here
}),
// Add other properties as needed
});
const settingsValidator = new MeteorSettingsValidator(MeteorSettingsSchema);
const settings = settingsValidator.get();
Contribute: Feel free to contribute through issues and pull requests. It’s a simple yet powerful utility to streamline your Meteor development.
GitHub repository link.
Cheers,
Henrique