Urgent.News

What's breaking now, across thousands of outlets.

Tech

Two things must happen before our server module loads, and a require is all that enforces the order

Notifio is an Electron app whose main process is also its HTTP server. There is no child process: app.whenReady() fires, and then one line pulls an Express application into the same process the windows live in. That line is a require , inside a function, in a file where every other dependency is a top level import . It looks like an oversight, and it is load bearing. This post is about why,…

Notifio is an Electron app with the main process serving as its HTTP server. There is no child process, and the server loads due to a require statement inside a function at the top of the main.ts file. This order is crucial, as implicit initialisation order can be problematic if not properly managed. The two main constraints for the server module to load are: 1.

The PLAYWRIGHT_BROWSERS_PATH environment variable must point at the bundled browser, and 2. Writable directories must exist before the server loads. These constraints are satisfied by the order of the code, as require is a function call and import is not. If the file started with a static import, both the environment variable and directories would not be properly set, leading to potential failures deep within the module's structure.

The initDataDirs() function ensures the necessary directories are created, including a copy of the config.json file if it is missing. This setup is necessary before the server module loads, as other modules, such as the scraper and power monitor, also rely on the server's loadConfig() function, which requires a properly configured environment.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

about:config Settings Worth Changing (and What Not to Touch)

about:config is Firefox's advanced settings panel — a flat key-value store for hundreds of internal preferences. Most users never touch it.

  • DNS over HTTPS (Forced Mode) enhances privacy by routing DNS queries through a trusted resolver
  • Sanitize History on Shutdown clears cookies and history when Firefox closes for enhanced privacy

A memory benchmark draft with 17 axes and no headline number: is it worth running?

I work at a company that builds memory infrastructure, so I'm biased: we compete in the thing this benchmark measures. We wrote a long-term memory benchmark called glasshouse, and I'd like to know if…

  • Glasshouse is a memory benchmark with 17 separate axes, each reported individually.
  • Benchmark includes 2,847 questions, 1.97 million tokens, and 50 photographs in 10 languages.
  • Creator invites others to run the draft benchmark on their own memory systems.

One optional phone number, eleven files, five kinds of empty, and no migration

Yesterday I added an optional phone number to Nakodo. When a creator or a business says yes to a brand, the app introduces them by email, and the brand can now add a number to go with the address.

  • Nakodo app adds optional phone number feature
  • Phone number field consists of eleven files in commit
  • Database schema change requires single TypeScript line

Firefox Screenshots: Built-in Tool, DevTools, Headless CLI, and Playwright

Firefox has a built-in screenshot tool that's often overlooked. Combined with DevTools, you have flexible options for capturing pages exactly as needed.

  • Built-in tool captures visible content, full pages, or regions
  • DevTools offers controlled full page capture, including below-the-fold
  • Headless CLI via Playwright enables programmable screenshot generation

More from Friday 16 October →