A Quick First Look at Amazon Bedrock (with Node.js)

My regular readers (hello, yall rock!) know I’ve been playing with generative AI the past few months. I’m still a bit skeptical about the amount of hype involved around the space, but I’m slowly getting more excited as I see some of the interesting possibilities available with these tools. Most of my recent exploration has been on the Google Gemini side, but after hearing my buddy Todd Sharp talk about Amazon Bedrock on his stream yesterday, I figured it was time to check it out. (FYI, you should absolutely check out his weekly Twitch show on the AWS Twitch channel called "Streaming on Streaming" – Wednesdays at 3PM CST.) Getting Started # So obviously, you want... more →
Posted in: JavaScript

Three Cool (to me) Node.js Features

I’ve been using Node.js on the regular now for probably over a decade, but one thing I’ve never done well is keep up to date with its features and new additions. In general, my brain just thinks "use javascript" and that’s all. The last time I really cared about what precisely was supported was when I was using fetch in client-side JavaScript and it wasn’t supported natively in Node. Luckily I could just use node-fetch and be done with it. That being said, I recognize I’ve not done a great job of keeping track of updates to Node itself so I try to notice it when folks mention it. Over the past week or so I’ve encountered not one, not two, but three... more →
Posted in: JavaScript

Quick example using AWS Node.js SDK V3 for Signed URLs

This probably falls into the "it was easy for everyone else in the world but me" bucket, but I really struggled to find good search results for this and figured I’d better write it down so when I google for it again in a few months, I’ll find my own blog. Specifically – today I was trying to use the AWS Node.js SDK to generate signed URLs. One to create read-only access to a bucket item and another to allow uploading. Everything I’m sharing is covered in the docs, but I struggled to find the relevant parts. So first off, V3 of the SDK is modularized, so instead of installing a giant SDK, you get just what you need. A lot of the demos show S3 so that’s handy.... more →
Posted in: JavaScript

How to Use window.crypto in Node.js

I’ve been writing a bunch of jest tests recently for libraries that use the underlying window.crypto methods like getRandomValues() and window.crypto.subtle key management methods. One problem I run into is that the window.crypto object isn’t available, so I need to shim it. To use the window.crypto methods, you will need Node 15+. You can set the window.crypto by importing the crypto package and setting it on the global: const crypto = require('crypto').webcrypto; // Shims the crypto property onto global global.crypto = crypto; I really loathe creating mock functions for missing libraries in Node because they can lead to faulty positives on tests; I really appreciate webcrypto... more →
Posted in: JavaScript

8 new JavaScript features you might have missed – InfoWorld

It’s not easy keeping up with all the new features the ECMAScript spec brings us every year. Let’s catch up with the highlights from ES11. The JavaScript juggernaut never stops. There are a number of features introduced by the “living spec” every year. Then it takes some time for the browsers, Node.js, etc. to roll them in, and before you know it, there’s a big pile of new JavaScript features you haven’t tried. It’s not too late. Here I’ve rounded up the ES11 (ECMAScript 11, aka ECMAScript 2020) features that you may have missed. They include a number of ergonomic and other modern improvements. Let’s take a look. Optional chaining Optional chaining is one of those simple-but-effective... more →
Posted in: JavaScript

Node.js 5.0.0 Released and Other JavaScript News – Softpedia News

Softpedia News Node.js 5.0.0 Released and Other JavaScript NewsSoftpedia NewsThe Node.js team has announced the immediate availability of the Node.js 5.0.0 project, a server-side implementation of the JavaScript programming language (in layman's terms). This might seem a quick release, judging that only a month back the project …Node.js 5: No rest between releasesInfoWorldall 3 news articles » JavaScript – Google News… more →
Posted in: JavaScript