Use Vercel's Pkg to Bundle Node.js and Your Code Into a Shareable Executable

pkg bundling up a node.js hello world app

I’ve been building Alfred workflows quite a bit recently and have started leveraging the Script Filter while leveraging node packages and scripts. This works great for my own workflow where I know that I have node.js installed, but I worried quite a bit about sharing them with friends. Turns out there’s a simple way to package up your apps using a tool called pkg. It’s been working great for me, so I put together an egghead lesson about it: