Blog
-
Troubles with multipart form data and fetch in Node.js
This is one of those cathartic blog posts. One in which I spent several frustrating hours trying to debug something that really should have just worked. Once I had finally found out what was going on I felt that I had to write it all down just in case someone else is out there dealing with the same issue. So if you have found yourself in a situation where using
fetch
in Node.js for amultipart/form-data
request doesn’t work, this might help you out. -
Shallow clones versus structured clones
Have you ever had one of those times when you think you’re doing everything right, yet still you get an unexpected bug in your application? Particularly when it is state-related and you thought you did everything you could to isolate the state by making copies instead of mutating it in place.
-
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 perhaps reached for lodash’s
groupBy
function. -
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 intoprocess.env
in your Node.js application completely dependency-free. -
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
<Pagination />
component on npm as @philnash/astro-pagination that anyone can use in their Astro site. Read on to find out more. -
Build bots on Bluesky with Node.js and GitHub Actions
Bluesky is the new social network in town and it’s an exciting place to explore right now. I was fortunate enough to get an invite early on and take part in the early community. But Bluesky is not just a Twitter clone, it’s an application on top of The AT Protocol, a (still being built) federated protocol for social networks with some interesting properties.
-
Create a CLI Chatbot with the ChatGPT API and Node.js
ChatGPT has taken the world by storm and this week OpenAI released the ChatGPT API. I’ve spent some time playing with ChatGPT in the browser, but the best way to really get on board with these new capabilities is to try building something with it. With the API available, now is that time.
-
The yaml document from hell — JavaScript edition
I recently came across this blog post from Ruud van Asseldonk titled “The yaml document from hell”. I’ve always heard that yaml has its pitfalls, but hadn’t looked into the details and thankfully hadn’t been affected, mainly due to my very infrequent and simple use of yaml. If you are in the same boat as me, I recommend reading that article now as I almost can’t believe I’ve avoided any issues with it.
-
Better two factor authentication experiences with WebOTP
Two factor authentication (2FA) is a great way to improve the security of user accounts in an application. It helps protect against common issues with passwords, like users picking easily guessable passwords or reusing the same password across multiple sites. There are different ways to implement two factor authentication, including SMS, using an authenticator application and WebAuthn.
-
Alias your Mastodon username to your own domain with Jekyll
Mastodon is different to most online services. It is a federated network, so when you set up an account you need to choose a server to use. Your username then becomes a combination of your handle and that server you signed up to. For example, I am currently @philnash@mastodon.social.
Subscribe
To keep up with posts on this blog, you can subscribe via RSS or follow me on DEV.