Skip Navigation
Generate Related Posts for Your Astro Blog with Vector Search
www.datastax.com Generate Related Posts for Your Astro Blog with Astra DB Vector Search | DataStax

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 Astra DB Vector Search | DataStax
0
__dirname is back in Node.js with ES modules
www.sonarsource.com __dirname is back in Node.js with ES modules

Node.js is reducing friction when using ES modules by making it easier to get the current module directory name

__dirname is back in Node.js with ES modules

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.

0
__dirname is back in Node.js with ES modules
www.sonarsource.com __dirname is back in Node.js with ES modules

Node.js is reducing friction when using ES modules by making it easier to get the current module directory name

__dirname is back in Node.js with ES modules

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.

0
Creating your own image generation model using JavaScript
dkundel.com Creating your own image generation model using JavaScript

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.

Creating your own image generation model using JavaScript
0
Union, intersection, difference, and more are coming to JavaScript Sets
www.sonarsource.com Union, intersection, difference, and more are coming to JavaScript Sets

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.

Union, intersection, difference, and more are coming to JavaScript Sets
0
Lessons learned upgrading to React 18 in SonarQube
www.sonarsource.com Lessons learned upgrading to React 18 in SonarQube

We share the biggest three issues we faced and the lessons we learned as we upgraded SonarQube to React 18.

Lessons learned upgrading to React 18 in SonarQube
0
Stop nesting ternaries in JavaScript
www.sonarsource.com Stop nesting ternaries in JavaScript

Nesting ternary operators makes code more complex and less clear. Let's investigate other ways to write conditional expressions.

Stop nesting ternaries in JavaScript
34
A comprehensive guide to the dangers of Regular Expressions in JavaScript
  • 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.

  • A comprehensive guide to the dangers of Regular Expressions 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!

  • Speeding up the JavaScript ecosystem - Polyfills gone rogue
    marvinh.dev Speeding up the JavaScript ecosystem - Polyfills gone rogue

    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.

    Speeding up the JavaScript ecosystem - Polyfills gone rogue
    1
    One Thing Nobody Explained To You About TypeScript
    redd.one One Thing Nobody Explained To You About TypeScript

    One of the most common mistakes in configuring TypeScript.

    One Thing Nobody Explained To You About TypeScript

    Click bait title, but this post goes into depth about using tsconfig.json correctly and across different layers of your project.

    0
    NODE_ENV Considered Harmful
    cjihrig.com NODE_ENV Considered Harmful

    At some point in the distant past, certain Node.js projects adopted the convention of using the NODE_ENV environment variable to denote how the project was being run. For example:

    0
    Typing your JavaScript without writing TypeScript
    www.sonarsource.com Typing your JavaScript without writing TypeScript

    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

    Typing your JavaScript without writing TypeScript

    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.

    0
    JavaScript is getting array grouping methods
    philna.sh JavaScript is getting array grouping methods

    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...

    JavaScript is getting array grouping methods
    0
    Get the benefits of TypeScript in your JavaScript
    www.sonarsource.com Get the benefits of TypeScript in your JavaScript

    Let's dive into what you can do to get more and more of TypeScript's benefits in your JavaScript projects.

    Get the benefits of TypeScript in your JavaScript
    0
    Node.js 20.6.0 includes built-in support for .env files
    philna.sh Node.js 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...

    Node.js includes built-in support for .env files
    2
    What is deeper SAST in JavaScript?
    www.sonarsource.com What is deeper SAST in JavaScript?

    What is SAST, what does deeper SAST mean, and how does this apply to your JavaScript and TypeScript applications?

    What is deeper SAST in JavaScript?
    0
    5 Inconvenient Truths about TypeScript
    oida.dev 5 Inconvenient Truths about TypeScript

    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:

    5 Inconvenient Truths about TypeScript
    0
    Easy and accessible pagination links for your Astro collections
    philna.sh Easy and accessible pagination links for your Astro collections

    Generating pagination links is not as straightforward as it may seem. So, while rebuilding my own site with Astro, I released a component on...

    Easy and accessible pagination links for your Astro collections
    0
    InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)PH
    philnash @programming.dev
    Posts 22
    Comments 6