Skip to content

Instantly share code, notes, and snippets.

View amanzrx4's full-sized avatar

aman sagar amanzrx4

View GitHub Profile
@amanzrx4
amanzrx4 / settings.json
Created December 18, 2024 22:28
vscode settings
{
"editor.fontSize": 16,
"editor.fontFamily": "Menlo, Monaco, 'Courier New', monospace",
"terminal.integrated.fontSize": 14,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
@amanzrx4
amanzrx4 / env-variables.ts
Last active June 17, 2024 09:47
type safe env variable parsing with valibot
import { config } from 'dotenv';
import type { InferInput, ValiError } from 'valibot';
import { object, parse, string } from 'valibot';
config();
const envVariables = object({
MY_KEY: string(),
});
parse(envVariables, process.env);