πΊπ¦ KOTYK isn't just a cat β it's a Ukrainian-grade configuration layer. Strict, type-safe, and always watching your
environment
variables like a guardian. Noundefined
, no silent failures, and absolutely no mercy for missingAPI_KEY
s.
- β Just like real cats, KOTYK reacts instantly β that's why it's implemented in seconds.
- β Built with Zod for runtime type safety
- β Fails fast at startup if any variables are missing or invalid
- β Automatically cached via the module system β import it anywhere
- β
No more scattered
process.env.X
β justenvironment.X
- β Designed for backend apps, CLI tools, SSR, and monorepos
Konfigured Only Typed Yielded Keys
Yes, "Konfigured" with a K. Because this isn't just another kitty β KOTYK is a proud πΊπ¦πΌ
yarn add zod dotenv
import 'dotenv/config';
import { z } from 'zod';
const schema = z.object({
WHISKER_API_KEY: z.string().min(1, 'WHISKER_API_KEY is required'),
SCRATCH_RETRY_LIMIT: z.coerce.number().int().min(0, 'Must be non-negative'),
});
export type Environment = z.infer<typeof schema>;
export const environment: Readonly<Environment> = Object.freeze(
(() => {
try {
return schema.parse(process.env);
} catch (err) {
console.error('πΏ Failed to validate environment variables! KOTYK refuses to start.');
console.error('π¦ Did you forget to copy .env.example and set your secrets?\n');
throw err;
}
})()
);
import { environment } from 'env.kotyk.js';
if (retries > environment.SCRATCH_RETRY_LIMIT) {
throw new Error('πΎ Too many retries! KOTYK scratched the request.');
}
WHISKER_API_KEY=your-whisker-key
SCRATCH_RETRY_LIMIT=3
- π₯ If a variable is missing β KOTYK will stop the build
- πΌ If you try
undefined
β KOTYK will paw your CI - π― No more
as string
,|| ''
, orparseInt()
scattered everywhere - πΎ KOTYK is not just a config helper β it's your trusted configuration sentinel
If this little πΊπ¦ KOTYK made your config safer or brought a smile to your CI β consider giving it a βοΈ!
MIT
But KOTYK reserves the right to stare disapprovingly at anyone who touches process.env
directly.