BoxLang Quick Tips – Working with JSON

Welcome to another BoxLang quick tip – today I’m going to focus on working with JSON in BoxLang. Now, as you can probably guess, JSON is natively supported and supports what you would expect, going to and from JSON, but there’s some particularities of the support that may interest you, so I’ve dug into it. As with my other quick tips, you can skip to the video version at the bottom if you prefer. The Basics Converting data to JSON can be done two ways, either via the built in function (BIF) jsonSerialize or the member function toJSON. There’s no difference here, just use what makes sense for you: name = "Raymond"; age = 52; hobbies = ["beer","books","movies","video... more →
Posted in: JavaScript

BoxLang Quick Tips – Sending Email

Welcome to another BoxLang Quick Tip! As with my other quick tips, I’ll end this blog post with a link to the video version so feel free to skip down to it, or read, or both if you prefer! Today’s quick tip is a look at how BoxLang supports sending email, and as with my previous tips, an additional module is all you need to do. The Mail module can be installed via the CLI like so: install-bx-module bx-mail. Once installed, you get three new components for your runtime: mail – This is the core component and handles all mail operations. You’ll always use this. It has quite a few options so be sure to check the docs, but in general you’ll provide the to, from, subject,... more →
Posted in: JavaScript

BoxLang Quick Tips – PDF Generation

Today’s BoxLang quick tip is one near and dear to my heart, generating PDFs. Creating dynamic, expressive PDFs is fairly easy. Let me show you how. As before, I’ve got a video version as well so you would rather watch that, just skip to the end. Step One – The Module By default, BoxLang doesn’t ship with PDF capabilities built-in, you need to add it via the PDF Module. This can be done quickly via the CLI: install-bx-module bx-pdf Installing the module adds three new tags to your BoxLang runtime: bx:document – This is the core tag for PDF generation. Everything inside it will either be content or directives (see the items below) to control what’s produced. bx:documentitem... more →
Posted in: JavaScript

BoxLang Quick Tips – Database Access

Today I’m kicking off a new blog/video series of quick tips for people interested in BoxLang. These ‘quick tips’ are just that, a look at how BoxLang can simplify working with the JVM and building CLI scripts, web apps, and serverless applications. Each of these posts will include a video along with sample code and help highlight some of the ways BoxLang can be powerful in just a few lines of code. For my first quick tip, let’s talk database access, which by the way was one of the reasons I got into ColdFusion nearly thirty years ago (I didn’t want to figure out how to do it in Perl!). Working with databases in BoxLang can be done in a few steps. Step One –... more →
Posted in: JavaScript

Quick Demo of Chrome’s Summarization GenAI (Upcoming) API

I’ve blogged a few times recently about Google’s AI on Chrome initiative to bring AI features to the browser itself. Yesterday, my Code Break episode was specifically on this topic: Play Video In that session, I talk specifically about the Summarizer API, which does… wait for it… summarization. (It also covers the Writer and Rewriter API which I covered… woah, way back in September of last year: "Using Chrome AI to Rewrite Text") One interesting aspect of the API is that it offers multiple types of summarization: key points (the default) tl;dr teaser headline You can also request three different lengths: short medium (default) long According... more →
Posted in: JavaScript

Quick Example using Azure’s Node.js SDK for Signed URLs

Way back in June (wait, that’s only two months ago?) I wrote up a blog post showing how to use the AWS SDK for Signed URLs: "Quick example using AWS Node.js SDK V3 for Signed URLs". The idea for this was to cover a very specific set of functionality I needed to use along with Adobe’s Firefly Services. Specifically my needs are: Create a readable URL for a cloud storage asset Create a writable URL for a cloud storage asset And on top of that – also I needed to upload directly to cloud storage. I worked with Azure Storage Blob SDK and came up with the following functions. Honestly, use this with a grain of salt as it "worked for me", but I can’t make... more →
Posted in: JavaScript

A Quick Look at AI in Chrome

Google announced a while back their intent to experiment with generative AI in the browser itself. Personally, I think this could be a really good idea, but I’m really unsure as to how many other vendors would support it. With Edge being a Chromium product, and Microsoft being pro-GenAI, it seems like a safe bet it would support it. Safari and Firefox… I honestly feel like they probably never would. That being said, initial support landed in Chrome Canary (the bleeding edge version of Chrome) and I thought I’d take a quick look. Here’s what I found. Setting it Up To test this new feature, you need either Chrome Canary or Dev. Enabling support requires tweaking two flags... more →
Posted in: JavaScript

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
1 2