config
dotenv
Our great sponsors
config | dotenv | |
---|---|---|
32 | 219 | |
6,082 | 18,370 | |
0.4% | - | |
4.5 | 9.0 | |
5 months ago | 22 days ago | |
Java | JavaScript | |
Apache License 2.0 | BSD 2-clause "Simplified" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
config
-
XML is better than YAML
I don‘t understand why HOCON (https://github.com/lightbend/config/blob/main/HOCON.md) isn‘t used more often (at least for configuration use cases). It‘s a superset of JSON, has comments, multiline strings, optional quotes, replacement syntax. We use it at many places, and it‘s as nice at it can get.
This is one of the few HN discussions where I feel a little bit qualified to give an opinion :)
Two years ago I started a small data quality checker software where users could define their alerts, frequencies,.. all in config files instead of modifying code.
I started with JSON as config format, but then realised comments are necessary to guide users in defining alerts. I moved to YAML, but after some "indentation incodents" started using HOCON conf [0] and never looked back. I don't see any reason for choosing YAML over one of JSON or HOCON, except being forced to. Features such as inheritance and text block support which were essential for me are nicely supported in HOCON.
- Toml-bench – Which toml package to use in Python?
- slf4j or System.Logger?
- TOML: Tom's Obvious Minimal Language
-
Ron: Rusty Object Notation
HOCON is a great human-readable alternative to JSON. It's a superset of JSON with lots of cool features that make it both more readable and easier to use.
Here's a rundown of HOCON's main features: https://github.com/lightbend/config#features-of-hocon
-
Spring and scala
For reading configuration files, I would probably use this: https://github.com/lightbend/config instead of Spring.
"Typesafe Config" is the library generally used to read configuration files in HOCON format, which this library introduced. It's commonly used in essentially OOP/imperative Scala contexts, including Akka and its ecosystem.
-
Make systemd better for Podman with Quadlet
Interesting!
For my own servers I use an internal tool that integrates apps with systemd. You point it at the output of your build system and a config file, and it produces a deb that contains systemd unit files and which registers/starts the server on install/reboot/upgrade, as a regular debian package would. Then it uploads it to the server via sftp and installs it using apt, so dependencies are resolved. As part of the build process it can download and bundle language runtimes (I use it with a JVM), it scans native binaries to find packages that the app should depend on, and you can define your config including package metadata like dependencies and systemd units using the HOCON language [1].
Upshot is you can go from a Gradle or Maven build to a running server with a few lines of config. Oh and it can build debs from any OS, so you can push from macOS and Windows too. If your server needs to depend on e.g. Postgres, you just add that dependency in your config and it'll be up and running after the push.
It also has features to turn on DynamicUser and other sandboxing features. I think I'll experiment with socket activation next, and then bundled BorgBackup.
Net/net it's pretty nice. I haven't tried with containers because many language ecosystems don't seem to really need them for many use cases. If your build tool knows how to download your language runtime and bundle it sans container by just setting up paths correctly, then going without means you can rely on your Linux distribution to keep things up to date with security patches in the background, it means networking works as you'd expect (no accidentally opened firewall ports!) and so on. SystemD knows how to configure resource isolation/cgroups and kernel sandboxing, so if you need those you can just write that into your build config and it's done. Or not, as you wish.
With a deployment tool to automate builds/pushes, systemd to supervise processes and a big beefy dedicated machine to let you scale up, I wonder how much value the container part is really still providing if you don't need the full functionality of Kubernetes.
-
Introducing JXC: An extensible, expressive data language. It's a drop-in replacement for JSON and supports type annotations, numeric suffixes, base64 strings, and more!
Other similar standards: TOML, HOCON
dotenv
-
Tutorial: React + Emailjs
We will put our Emailjs environment variables in a dotenv (.env) file. To read more about the purpose of this file click here.
-
How to Use Environment Variables in Node.js
Add .env to your .gitignore file to prevent it from being committed. Here's an example file with it already added. You may also use dotenv for advanced configuration and it will automatically load environment variables from a .env file into process.env.
-
Extracting YouTube video data with OpenAI and LangChain
dotenv: Designed to load environment variables from a .env file into the process.env environment
-
Top Secrets Management Tools for 2024
Like Doppler, Infisical uses environment variable injection. Similar to the Dotenv package for Node, when used in Node, it injects them at run time into the process object of the running app so they're not readable by any other processes or users. They can still be revealed by a crash dump or logging, so that is a caveat to consider in your code and build scripts.
- AI for Web Devs: Your First API Request to OpenAI
-
An intro to Appwrite | Building a To-do list with SvelteKit
We'll be working with databases' ids and different info that should be secured so I would advise you to create a .env file to store said info. We'll do this by installing dotenv into our project and use it accordingly:
-
Building and deploying AI agents with E2B
dotenv - For reading our API keys from the environment
- Servidor para Blog, com Autenticação JWT - Node.Js & Mysql
-
How to get the count of your followers on dev.to
Add the following code to your index.js file. Make sure to update the API_TOKEN with your secret. Even better: Use the dotenv NPM package to keep your code free of secret keys.
-
How to implement a vector database for AI
Let’s break down what’s happening here. First, we import the necessary packages, the Weaviate client and the dotenv configuration. dotenv is a package that loads environment variables from a .env file into process.env. The Weaviate and OpenAI keys and URLs are typically stored in environment variables to keep them secret and out of your codebase.
What are some alternatives?
cross-env
multiline
Electron - :electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS
hardhat-deploy - hardhat deployment plugin
fastify - Fast and low overhead web framework, for Node.js
cfg4j - Modern configuration library for distributed apps written in Java.
owner - Get rid of the boilerplate code in properties based configuration.
Visual Studio Code - Public documentation for Visual Studio Code
axios - Promise based HTTP client for the browser and node.js
CodeceptJS - Supercharged End 2 End Testing Framework for NodeJS
dotenv - A twelve-factor configuration (12factor.net/config) library for Java 8+
stringify-object - Stringify an object/array like JSON.stringify just without all the double-quotes