fell, to programming
@fell@ma.fellr.net avatar

Without going into too much detail, my thesis was criticised for developing a web service with C++. I It was questioned why I didn't use or for the web service. "It's not performance critical" said the professor.

Dude, have you used the internet lately?

EVERYTHING is performance critical!

This sort of teaching explains why most aps/websites run like absolute dogshit.

Why is never an academic criteria?

I wish @cmuratori could see this...

mjgardner, (edited ) to programming
@mjgardner@social.sdf.org avatar

This is hilarious. A engineer invented to make command line scripting easier with , because at a certain point scripts get too complicated and you need a Real Language.

https://github.com/google/zx/

This is exactly ’s use case from thirty-six years ago. But the kids want everywhere and would rather it take more work to convert their ascended scripts to a vastly different syntax.

https://github.com/google/zx/issues/581#issuecomment-1516573139

markstos, to programming
@markstos@urbanists.social avatar

For MLK day here in the US, I'm going to be doing some equity work with and mabe some and posting some updates throughout the day in this thread. If that's your jam, follow along.

Otherwise, you may want to mute me for 24 hours, because this may get noisy. 🧵

joelanman, to programming
@joelanman@hachyderm.io avatar

In Node you can easily load json like this:

const myData = require('data.json')  

is there an equivalent in the new import syntax?

thisismissem, to programming
@thisismissem@hachyderm.io avatar

Here's a fun one for folks: when using the cluster module, how do you get the total count of connections to a net.Server?

Because it's not getConnections, that seems to only return the number of connections for the current fork, as increasing the cluster fork number but keeping the connection load the same sees the number of connections decrease proportionally to the cluster fork number.

This seems to be a bug in Node.js, but I don't yet have reproducible code to prove it.

stefan, to fediverse
@stefan@stefanbohacek.online avatar

Do you want to add a "log in with your fediverse account" functionality to your site? I am working on a self-hosted node.js server that lets you do just that.

Care to give it a try?

https://github.com/stefanbohacek/auth-server

You can see it working on:

cjerrington, to fedora
@cjerrington@mstdn.social avatar

Does 38 only support version 16? I'm needing to install version 18, but even with 'dnf module list nodejs' only 16 shows up.

wiredprairie, to programming
@wiredprairie@mastodon.social avatar

I'm enjoying the ease of use of the npm package 'postgres'. I'd tried a few other options that were a bit more "ORM" and not had great success.

It's not simple -- but that's good as it's feature set is definitely robust. Also works well with Typescript.

It took me about 45 minutes to swap from Kysely.

https://www.npmjs.com/package/postgres

joelanman, to programming
@joelanman@hachyderm.io avatar

missing from native Node - write a file and create any necessary folders in the path

fs.writeFileSync('a/b/c.txt','hello', {recursive:true})  

aral, (edited ) to programming
@aral@mastodon.ar.al avatar

FML, something that’s changed between Node 12.16.2 and 18.16.0 has made the OCSP stapling library I’m using¹ 1,000× slower (~4ms vs ~4s per request).

At least I know where the issue is… Tomorrow, I dig into the library to try and narrow it down further.

(The network graph in Firefox was useful as it showed that the problem was with the TLS Setup. And 0x² and its flame graphs helped me narrow it down further.)

¹ https://github.com/indutny/ocsp#ocsp-apis-for-nodejs-
² https://github.com/davidmarkclements/0x#readme

aral, to javascript
@aral@mastodon.ar.al avatar

Hey folks, I just released Auto Encrypt Localhost* v8.4.0 with better async support and updated dependencies.

https://www.npmjs.com/package/@small-tech/auto-encrypt-localhost

  • My pure JavaScript module (no mkcert, certutil, etc., required) that automatically provisions and installs locally-trusted TLS certificates for Node.js https servers.

(There seems to be an issue with tests failing on macOS, will debug that tomorrow and likely post a patch release.)

aral, to programming
@aral@mastodon.ar.al avatar

Me: Hmm, maybe I should look into Bun again and see how its Node.js compatibility is coming along.

Also me: I wonder who makes Bun…

Me, yet again: Ah, it’s a venture-capital funded startup called Oven (see what they did there?)

Finally, me: rm -rf ~/.bun

(Remember, kids: Venture capital is the fart that precedes enshittification. It’s best not to linger once you’ve caught a whiff of it.)

aral, to SmallWeb
@aral@mastodon.ar.al avatar

Hands up, who lives in/around Dublin and is interested in Small Web¹ and Kitten²?

(Am I trying to gauge if there’d be enough interest for an impromptu, informal little meetup over food/drinks this evening? Maybe…) ;)

¹ https://ar.al/2020/08/07/what-is-the-small-web/

² https://codeberg.org/kitten/app

aral, (edited ) to SmallWeb
@aral@mastodon.ar.al avatar

New blog post: Streaming HTML

https://ar.al/2024/03/08/streaming-html/

Let me show you how easy it is to create a simple counter web app using the new Streaming HTML workflow in Kitten before peeling away the magic layer by layer so you learn how to make the same app using:

• HTMX & WebSockets
• Plain old JavaScript, and, finally,
• Without Kitten in pure Node.js.

Enjoy + let me know what you think.

:kitten: 💕

thisismissem, to programming German
@thisismissem@hachyderm.io avatar

Really? A contest? We're still doing spec work are we ? I honestly expected better from the Node.js TSC and similar steering groups for the project.

https://twitter.com/nodejs/status/1713984983566610540

anianimalsmoe, to random
@anianimalsmoe@sakurajima.moe avatar

Trying to switch my small utility projects to bunx. :meowthinking:

aral, to javascript
@aral@mastodon.ar.al avatar

In almost three decades of writing JavaScript (yes, I’m older than JavaScript), this is the first time I’ve used a label and a break label statement for a conditional.

I feel strangely fine about it.

thisismissem, to programming
@thisismissem@hachyderm.io avatar

If anyone's hiring a mid-level or associate software engineer (react / node.js / solid) remote (Germany), I highly encourage you to get in contact with @yesvirginia, who's just parted ways with Inrupt, where we worked together.

She's looking for her next role, must be remote, and minimum salary ~€75-80k.

She's not just a talented developer, but also a huge people person, often driving positive change, and is running for the Chair of the Solid CG.

aral, to programming
@aral@mastodon.ar.al avatar

Just released a tiny Node module that parses the attributes from a single tag (any attribute from anything that looks like a tag, not just valid attributes from HTML tags).

https://codeberg.org/small-tech/attribute-parser

(Regular expressions just don’t cut it when you want to support boolean attributes as well as attributes with dashes in the names and unquoted, single-quoted, and double-quoted values.)

aral, to programming
@aral@mastodon.ar.al avatar

There are times I think JavaScript (and Node.js) do deserve their reputation…

(Ok, ok, I don’t, but what is this, really?)

“Date.prototype.toISOString called on incompatible receiver [object Date]”

smh

manlycoffee, to javascript
@manlycoffee@techhub.social avatar

In JavaScript/TypeScript, what is the current trending idiom with "raising an error"?

The throw keyword makes me feel angsty.

Are people still using that?

thisismissem, to programming
@thisismissem@hachyderm.io avatar

Say I wanted to do a very standard CRUD style application in Node.js, and wanted to avoid express, what would people use? I'm fine with purely server-side rendering.

rstacruz, to programming
@rstacruz@hachyderm.io avatar

Been using Volta for a long time now to manage my setup, but been slowly feeling like it's being made redundant with Corepack becoming more mature.

I switched to Mise for a few weeks and found a few interesting things 😀

https://ricostacruz.com/posts/mise-vs-volta

jaandrle, (edited ) to programming
@jaandrle@fosstodon.org avatar

🎉 nodejsscript@v1.0.0 :nodejs:
Easy cross-platform “one–file” scripting using JavaScript.

You can use it as:

Gradually replenished thread 👇

joelanman, to programming
@joelanman@hachyderm.io avatar

I'm using Playwright to do end to end testing and very happy with it. How do I now add unit testing? Googling isnt giving very useful results. I'm imagining something like

npm test  

triggering Jest, then Playwright, but they both look for test.js files so that seems not correct?

Can/should Playwright be used for unit testing?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • tacticalgear
  • DreamBathrooms
  • InstantRegret
  • magazineikmin
  • Youngstown
  • everett
  • anitta
  • slotface
  • GTA5RPClips
  • rosin
  • thenastyranch
  • kavyap
  • mdbf
  • Leos
  • modclub
  • osvaldo12
  • Durango
  • khanakhh
  • provamag3
  • cisconetworking
  • ngwrru68w68
  • cubers
  • tester
  • ethstaker
  • megavids
  • normalnudes
  • lostlight
  • All magazines