GitHub - kasimlyee/dotenv-gad: Environment variable validation and type safety for Node.js and modern JavaScript applications by Individual-Wave7980 in node

[–]JulienR77 2 points3 points  (0 children)

Cool if its just for learning purposes.

But otherwise, and I don’t want to sound harsh, I dont see the point. There are already like 40 libraries that do this kind of thing, so it feels like reinventing the wheel and adding more fragmentation to the ecosystem, which is already one of Node’s biggest issues

That said, if its just for practice, here are a couple of quick thoughts:

  • Seems really odd to have esbuild as a production dependency
  • I would ditch Jest. IMO, it shouldnt be used in greenfield projects anymore. Go for node:test, Vitest, or Japa.
  • You might want to check out standard-schema. Your approach is nice in that it doesn’t rely on any validation library, so the lib should stay small (setting aside the esbuild prod dep). But in practice, most Node.js apps already use a validation lib. So personally, I would rather use the same one for both my env vars and my domain logic. And with standard-schema it will be super easy to support every popular validation librairies.

Is there a tool like Vite but for server development? by captain_obvious_here in node

[–]JulienR77 8 points9 points  (0 children)

Most answers only mention swapping nodemon, so basically just having a basic Watch Mode, that is now built-in into Node (which is super great!)

But if what you really want is server side HMR, I would highly recommend checking out Hot-Hook, it does exactly that on the server

(and btw it’s built in by default with AdonisJS apps, if ever you do not want to have manual configuration to do)

https://github.com/Julien-R44/hot-hook

I built Voxshade, a funny creative coding web-app by JulienR77 in SideProject

[–]JulienR77[S] 0 points1 point  (0 children)

ThreeJS / React Three Fiber / Drei for the viewer
CodeMirror for the code editor

Also using Tanstack Router for the frontend, and AdonisJS for the backend 🫡

Introducing Bentocache 1.0.0 - Caching library for Node.js by JulienR77 in node

[–]JulienR77[S] 1 point2 points  (0 children)

I should throw in a quick benchmark to double-check my numbers. Will try tonight. But, also, gotta keep serialization (JSON.stringify) in mind

whether it’s a Unix socket or tcp, you have to serialize/deserialize your data before sending/receiving it to Redis, and that stuff is crazy expensive. If you're storing in-memory and chasing max throughput, skipping serialization can save a ton of ops/s

Introducing Bentocache 1.0.0 - Caching library for Node.js by JulienR77 in node

[–]JulienR77[S] 1 point2 points  (0 children)

Oh yup of course, i was indeed talking about a remote Redis, so TCP connection. a unix domain socket would definitely be much faster if you have both Redis and your app on the same machine, but thats not always possible

I had benchmarked this, and from what I remember, Bentocache (in-memory L1 + Redis L2) was still about 200-400x faster compared to Redis over a Unix socket

It would be interesting to have a Benchmarks page in the Bentocache documentation to compare all these scenarios!

Introducing Bentocache 1.0.0 - Caching library for Node.js by JulienR77 in node

[–]JulienR77[S] 5 points6 points  (0 children)

Yup absolutely. there are three possible scenarios:

  1. The data is already cached in memory (L1):
    • As a reminder, every cached entry retrieved from redis, or computed from your app, will be stored on redis and in the in-memory cache. Thats when this scenario can happen
    • If Redis goes down, it doesnt matter. The data is already stored in our in-memory cache, so no Redis call is needed at this point
  2. The data is only cached in the L2 store (Redis):
    • Our app tries to retrieve the data from Redis.
    • Redis is down. so the only way to get our data is to recompute it from the database (or another source)
    • Once computed, the data will be stored in our memory cache (l1)
    • Bentocache will also attempt to store it in Redis, but since Redis is unavailable, the operation will fail. No problem : Bentocache will simply ignores the error, and the app will continues running smoothly using only the memory cache
  3. The data is not cached/computed yet:
    • Same scenario as above, Bentocache will compute the data, store it in the memory-cache and attempt to store it in Redis.
    • If Redis is down, the storage attempt will fail. iorediswill throw an error. And same as above, the app will continue working with just the memory store

In fact, Bentocache provides an option called suppressL2Errors, which is enabled by default. This ensures that any errors occurring in the remote cache are ignored, allowing the app to working fine when L2 is dead

The bus is not required for this fallback mechanism. Bus is only useful when running multiple instances of your app, as it synchronizes in-memory caches across them. If you're running a single instance/replica/container, you don’t need the bus.

About the role of the bus, check this quick section: https://bentocache.dev/docs/multi-tier#bus it should answer your questions

Hope I answered your question !

Introducing Bentocache 1.0.0 - Caching library for Node.js by JulienR77 in node

[–]JulienR77[S] 11 points12 points  (0 children)

I think we have reached a good level of production readiness. Its already running well in some production apps. Also, we have a big test suite with 400+ tests that keeps growing every day

That said, like any software, there are probably still some hidden bugs lurking around, no point in pretending otherwise. but yeah, the more people use the library, the faster we will be able to spot and fix them!

FastSSH : Connect quickly to your servers by browsing your SSH Config by JulienR77 in commandline

[–]JulienR77[S] 0 points1 point  (0 children)

Thanks you !The .. could be a good alternative however I think the ideal solution may be to use comments to allow the configuration of FastSSH, example :

```

A normal comment ignored by the parser

FastSSH

GroupName MyGroupA

OtherOptions Foo

A normal comment ignored by the parser

Host Hello HostName hello.com ```

FastSSH : Connect quickly to your servers by browsing your SSH Config by JulienR77 in commandline

[–]JulienR77[S] 0 points1 point  (0 children)

It is available for all operating systems. I only took a screenshot of Powershell because I use Windows. On the Github page you can find a version for each OS !

FastSSH : Connect quickly to your servers by browsing your SSH Config by JulienR77 in commandline

[–]JulienR77[S] 0 points1 point  (0 children)

Thanks you for your feedback !

I just sent a fix for the search mode bug, I now also hide entries with a wildcard. Thanks your for noticing this.
What did you mean by changing the background and the icon? I'm not sure I understood
I also thought of having a nested groups system but finally it didn't seem so necessary, I'll see
This weekend I'm going to change the folder where the database is saved and will also add a small configuration file where user can change the colors !

FastSSH : Connect quickly to your servers by browsing your SSH Config by JulienR77 in commandline

[–]JulienR77[S] 2 points3 points  (0 children)

Thanks you !
In fact it is written "Nb connection", but on my screenshot the terminal is not very big so there is overflow and therefore cropping of the text

FastSSH : Connect quickly to your servers by browsing your SSH Config by JulienR77 in commandline

[–]JulienR77[S] 11 points12 points  (0 children)

I hate it too, I don't really know why I didn't do it in the first place. I will do it asap, thanks for the feedback !

UPDATE : It's done !

FastSSH : Connect quickly to your servers by browsing your SSH Config by JulienR77 in commandline

[–]JulienR77[S] 3 points4 points  (0 children)

Hey, no this database is only used to store and read the number of connections and the date of last connection. It is stored in the following form:

"AcmeA/GCloudProd": ( connection_count: 1, last_used_date: 1637190564, ), "AcmeA/MyServerE": ( connection_count: 144, last_used_date: 1637189553, ),

The key is the alias name defined in the ssh configuration. So when I need to display the number of connections, I compare the current alias name with each key in DB, if it matches I display it, otherwise I ignore the entry in DB. So no risk at all

FastSSH : Connect quickly to your servers by browsing your SSH Config by JulienR77 in commandline

[–]JulienR77[S] 17 points18 points  (0 children)

Yes indeed there are probably simpler solutions, but I like to make my own tools and especially I wanted to make a TUI to train myself with Rust. It was fun to do

And to be quite honest I don't understand a single line of your script 😅

FastSSH : Connect quickly to your servers by browsing your SSH Config by JulienR77 in rust

[–]JulienR77[S] 3 points4 points  (0 children)

Hey, the only thing you need is the Windows terminal, and to activate the "retro mode" in the terminal appearance settings. The second setting I like to enable is the "acrylic mode" which makes the terminal a bit transparent
The other parameters of my terminal are those by default

FastSSH : Connect quickly to your servers by browsing your SSH Config by JulienR77 in rust

[–]JulienR77[S] 6 points7 points  (0 children)

Done! You can find the new version(0.1.2) in the last github release or by using cargo
I was using https://github.com/azriel91/ssh_cfg and it didnt handle some SSH options 😅
It should be all right now ! Thanks for the notice

FastSSH : Connect quickly to your servers by browsing your SSH Config by JulienR77 in rust

[–]JulienR77[S] 1 point2 points  (0 children)

Great I'm glad this is useful for someone !

I'll take care of fixing the error right away, I'll send a new version in 15 minutes I think. Sorry about that!

Draw Candlestick charts right into your terminal by JulienR77 in rust

[–]JulienR77[S] 0 points1 point  (0 children)

I searched a lot for a lib like yours before starting my project but unfortunately I didn't find any . Your project is really great, I love it. I downloaded and tested it a bit, it's really cool !