
Learn how to add a related posts feature to a blog built with JavaScript framework Astro using Astra DB and OpenAI vector embeddings.

Generate Related Posts for Your Astro Blog with Vector Search
Learn how to add a related posts feature to a blog built with JavaScript framework Astro using Astra DB and OpenAI vector embeddings.
Node.js is reducing friction when using ES modules by making it easier to get the current module directory name
cross-posted from: https://programming.dev/post/11927506
Many times when I’ve tried to write some code in Node.js using ES modules I’ve found myself reaching for __dirname and then looking up how to replace it. Now Node.js, Deno and Bun support import.meta.dirname. Check out the article for more detail.
Node.js is reducing friction when using ES modules by making it easier to get the current module directory name
Many times when I’ve tried to write some code in Node.js using ES modules I’ve found myself reaching for __dirname and then looking up how to replace it. Now Node.js, Deno and Bun support import.meta.dirname. Check out the article for more detail.
Learn how you can create a custom text-to-image generation model using JavaScript, SDXL and Replicate without needing a machine learning background or needing specialized hardware.
The JavaScript Set was introduced to the language in the ES2015 spec, but it has always seemed incomplete. That's about to change with the addition of functions like intersection, union and difference.
We share the biggest three issues we faced and the lessons we learned as we upgraded SonarQube to React 18.
Nesting ternary operators makes code more complex and less clear. Let's investigate other ways to write conditional expressions.
That’s brilliant!
JavaScript's regex engine isn't the only one to have these problems. There certainly are other implementations, like Re2 and Rust's implementation, that don't have this issue. But they also lack some of the features of the JS implementation too.
While this article is about JavaScript specifically, these issues certainly exist in other regex engines too.
A deep investigation into regular expression denial of service (ReDoS) vulnerabilities in JavaScript
Ah, I didn’t realise there was a regex channel here. Thanks!
A deep investigation into regular expression denial of service (ReDoS) vulnerabilities in JavaScript
The only real way to validate an email address is send it an email and see if it arrives! I'm sure many of us have fallen to the urge to validate an email with a regex though, and yes, it's just too dangerous! I definitely like the simplicity of checking for an @
.
I think regular expressions are actually very tempting to use because they seem hard. I feel like I go through this XKCD comic every time the opportunity to use a regex comes up. But string functions often have the answer. I hope, if this article achieves anything, it just stops people using regex to trim whitespace!
Thanks!
A deep investigation into regular expression denial of service (ReDoS) vulnerabilities in JavaScript
Many popular npm packages depend on 6-8x more packages than they need to. Most of these are unnecessary polyfills and it's one of the key reasons node_modules folders are so large. The eslint ecosystem seems to be most affected by this.
One Thing Nobody Explained To You About TypeScript
redd.one is your first and best source for all of the information you’re looking for. From general topics to more of what you would expect to find here, redd.one has it all. We hope you find what you are searching for!
Click bait title, but this post goes into depth about using tsconfig.json correctly and across different layers of your project.
TypeScript already understands JavaScript, but you can get more out of it when you add types to your JavaScript with JSDoc or TypeScript declaration files
This is a follow up to my previous article on how to get more TypeScript benefits in your JavaScript. This goes into how to add types using JSDoc or TypeScript declaration files.
Grouping items in an array is one of those things you've probably done a load of times. Each time you would have written a grouping function by hand or...
Let's dive into what you can do to get more and more of TypeScript's benefits in your JavaScript projects.
Node.js 20.6.0 includes built-in support for .env files
With the recent release of version 20.6.0, Node.js now has built-in support for .env files. You can now load environment variables from a .env file into...
What is SAST, what does deeper SAST mean, and how does this apply to your JavaScript and TypeScript applications?
I’m writing books about TypeScript and I do workshops and trainings online and in-house. Every time I meet a new group of developers there are some TypeScript facts that they need to be confronted with:
Generating pagination links is not as straightforward as it may seem. So, while rebuilding my own site with Astro, I released a <Pagination /> component on...
Node.js released a new test runner in version 20. Let's dive in to how to write tests for JavaScript applications with the test runner.
Node.js version 20 comes with a new, built-in, stable test runner. This post takes a look into what you can do with it, with a small example test project.