#omgeving - Type-safe environment variables in Bun and Node

1 messages ยท Page 1 of 1 (latest)

lime trail
#

no

#

readme

#

love that ๐Ÿ™

wide radish
#

npm fault

lime trail
#

... no you have to publish things properly lmao

#

npm's doing its job perfectly

#

actually write things in your package.json

wide radish
#

how do i publish a readme

#

i'm new

lime trail
#

package.json

#

repository field

wide radish
#

oh

#

it doesn't work without a repository?

lime trail
#

no?

#

why wolud you package random text files to everyone downloading the package ever

wide radish
#

they say "add a README" i added a README.md and published a new version ๐Ÿคฃ i thought that'd work

lime trail
#

but i don't nkow why you wouldn't have a repo either way

wide radish
#

i just pnpm publish

lime trail
#

...

#

what

#

you don't need to ๐Ÿ˜ญ

wide radish
#

lol

wide radish
lime trail
#

? why would you

wide radish
#

._.

#

ah ok

#

so with github i have to pnpm publish and git commit?

#

lazy again lol

lime trail
#

why even type pnpm publish

wide radish
#

to publish?

lime trail
#

just fuck off and dont' publish bc you won't have users anw lmao

wide radish
#

._.

#

ok

lime trail
#

if you're too lazy to press git commit on your keyboard

#

maybe you need to rethink your life

wide radish
#

._.

lime trail
#

what you're doing

wide radish
#

i thought u were playful

lime trail
#

packages are primarily discovered on github

wide radish
#

now you're really saying i'm a piece of trash

lime trail
#

if you just hav ethem on npm they take up a name, no one finds them, and it's a waste of space for everyone

lime trail
#

im saying no one will ever find your package lmao

jaunty tundra
#

Why tf did this convo go this toxic ๐Ÿ—ฟ

lime trail
#

bro was too lazy to do the basics

jaunty tundra
#

So you tell them to "f*** off" and "rethink their life"?

#

Who hurt you lmfao

lime trail
#

a lot of people :(

#

but whats the point of publishing something if you don't plan to do like the basic fucking steps lmao

#

if you can't make a repo for it, which is like 90% of your publicity, then you're only wasting your time and npm's space

jaunty tundra
#

Why do you care this much? Everyone has to start somewhere

hexed kite
#

Dude, chill out

fleet quiver
#

the person who made is-even:

#

also um
I don't think it's a good idea to publish minified code

wide radish
#

oops my README was misspelled all along

#

lmao

#

๐Ÿ’€

fleet quiver
#

lol

wide radish
#

please find any bugs ๐Ÿ™

fleet quiver
#
export function number(options?: NumberOptions) {
  return { name: "number", options } as Validator as unknown as number;
}

export function string(options?: StringOptions) {
  return { name: "string", options } as Validator as unknown as string;
}

export function url(options?: URLOptions) {
  return { name: "url", options } as Validator as unknown as string;
}

export function port(options?: NumberOptions) {
  return { name: "port", options } as Validator as unknown as number;
}
``` the what
#

why the hell do you type assert this lol

wide radish
#

what do you mean

#

so i can get suggestions in name

fleet quiver
#

then why do you assert it to number or string

wide radish
#

i don't know a better way to do this

#

the number type is just being made from the return type of port or number

fleet quiver
#
function error(msg: string) {
  console.log(`omgeving: \x1b[31m${msg}`);

  process.exit(1);
}
``` Can't you just
throw then lol
wide radish
#

so i made this little function

fleet quiver
#

bruh

wide radish
#

envalid doesn't throw too, this lib is inspired by it

fleet quiver
#

you think what throwing will also do? exit the process

wide radish
#

its just to remove the stacktrace

fleet quiver
#

idk seems weird

#

also
why would you vaaildate your env variables

#

they don't come from a weird source

wide radish
#

._.

#

kinda too many questions

#

i'm feeling traumatized

fleet quiver
#

well
good that this one person has you blocked
because else they'd come and say something probably

wide radish
#

._.

#

no worries

#

you can replace him, clearly

fleet quiver
#

Just like I can write this code in 5 minutes

wide radish
#

i did kinda also write it in 5 minutes

#

it just took me long to make it more typesafe, work with node/bun and esm/cjs

#

๐Ÿ˜‰

#

it even works with deno if you're using it from npm (npm specifier or with pnpm)

fleet quiver
#

I'd like to write smth and publish it but
1.lack of ideas
2.idk if I remember my npm account password and stuff lol

wide radish
fleet quiver
lime trail
#

it apparently helps millions every day anw

fleet quiver
#

yes

lime trail
fleet quiver
#

troling

lime trail
#

imagine some random stupidass guy uses this in prod

fleet quiver
#

reply ping moment

lime trail
#

lol

lime trail
#

this guy

#

omg i realize why he was saying he was too lazy

#

he was just that afraid of people looking at his source code

#

because it's a fucking joke

jaunty tundra
#

You do not need to be a dick about it though

#

we all wrote code like this once

lime trail
#

๐Ÿ˜ญ

wide radish
#

i hate you

#

you're a piece of trash

#

you're legitimately demotivating me

#

i've had a few positive conversations with you before, but you fucked it up

#

you're an idiot

#

you lost someone who liked you, at least for some time

#

๐Ÿคทโ€โ™‚๏ธ

#

IT'S A FUCKING PIECE OF CODE

lime trail
#

i mean there are things you have to do if you want to help others, you aren't doing some of the basics and complaining about everything

wide radish
#

you'd never say me to what you said to me on discord in real life.

#

you're only silly online

lime trail
#

oh you don't know

#

i would be so much worse irl

#

i'd joke with you though

wide radish
#

you know deep down, its a fucking piece of code

wide radish
lime trail
#

i'm not saying you're a shitty coder overall, maybe you wrote some good code in the past, but as unknown as <type> is something you should almost never do in typescript

#

and a library should never exit on it's own

#

the control should be given to the one using it

#

those are just some basic principles you always follow when you write libraries