Publishing a simple client-side JavaScript package to npm with GitHub Actions | Simon Willison’s TILs

13-Dec-2024 23
Here's what I learned about publishing a single file JavaScript package to NPM for my Prompts.js project.For this project, I wanted to create an old-fashioned JavaScript file that you could include in a web page using a tag. No TypeScript, no React JSK, no additional dependencies, no build step. I also wanted to ship it to NPM, mainly so it would be magically available from various CDNs. I think I've boiled that down to about as simple as I can get. Here's the package.json file:.
Use coupon code:

JAVASCRIPT

to get 40% discount on our 'The JavaScript Interview Bible' book!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle