Skip Navigation
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
Posts
21
Comments
6
Joined
2 yr. ago
Astro @programming.dev
philnash @programming.dev

Generate Related Posts for Your Astro Blog with Vector Search

Node.js @programming.dev
philnash @programming.dev

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.

JavaScript @programming.dev
philnash @programming.dev

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.

JavaScript @programming.dev
philnash @programming.dev
JavaScript @programming.dev
philnash @programming.dev
React @programming.dev
philnash @programming.dev
JavaScript @programming.dev
philnash @programming.dev
  • 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.

  • RegEx @programming.dev
    philnash @programming.dev
    Programming @programming.dev
    philnash @programming.dev
  • 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!

  • JavaScript @programming.dev
    philnash @programming.dev
    JavaScript @programming.dev
    philnash @programming.dev
    TypeScript @programming.dev
    philnash @programming.dev

    One Thing Nobody Explained To You About TypeScript

    redd.one redd.one - redd Resources and Information.

    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.

    JavaScript @programming.dev
    philnash @programming.dev

    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.

    JavaScript @programming.dev
    philnash @programming.dev
    JavaScript @programming.dev
    philnash @programming.dev
    JavaScript @programming.dev
    philnash @programming.dev

    Node.js 20.6.0 includes built-in support for .env files

    JavaScript @programming.dev
    philnash @programming.dev
    TypeScript @programming.dev
    philnash @programming.dev
    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
    Astro @programming.dev
    philnash @programming.dev
    JavaScript @programming.dev
    philnash @programming.dev

    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.