NPM Packages with Monarch Wadia

Опубликовано: 24 Июнь 2026
на канале: Anthony Campolo
39
1

Monarch Wadia walks Anthony through the process of publishing an npm package, explaining key concepts like package.json, exports, and the bin field. They discuss the differences between Monarch's library Ragged and Anthony's planned CLI tool.

Monarch provides guidance on incrementally publishing versions and converting C++ code to Node.js when possible. The two plan to continue collaborating on their respective projects in future episodes.

00:00 - Introduction and Background

Monarch Wadia introduces himself as a full-stack web developer working on a library called Ragged, which is a simple wrapper for large language models. Anthony Campolo is the host of the show.

02:56 - Overview of Publishing to npm

Monarch explains that publishing to npm involves pushing code that gets registered against npm. He emphasizes the importance of testing the published package on other machines and incrementally publishing versions to catch issues early on.

11:55 - Exploring Ragged's Project Structure

Monarch shares his screen and walks through Ragged's project structure, which uses pnpm workspaces. He explains the main package, documentation, and examples directories.

20:53 - Ragged's package.json and Peer Dependencies

Anthony and Monarch examine Ragged's package.json file, noting its minimal dependencies. They discuss the role of peer dependencies and the potential for removing certain dependencies in the future.

27:49 - GitHub Actions for Publishing and Deployment

Monarch showcases the GitHub Actions workflows used in Ragged for publishing to npm and deploying documentation. He explains the various steps involved, such as setting up Node.js, caching, and authentication.

36:06 - Importance of the "exports" Field

Monarch emphasizes the significance of the "exports" field in package.json for defining the public interface of the package. This allows developers to control what users can import and helps maintain a good developer experience.

41:00 - Ragged's Tests and Type Declarations

Anthony inquires about Ragged's tests, and Monarch explains that they use ts-node to run the tests. He also discusses the role of type declaration files (d.ts) in providing type information for the package.

43:07 - Comparing Commander and Yargs for Building CLIs

Anthony shares his experience using Yargs to build a CLI tool and seeks Monarch's advice on choosing between Yargs and Commander. Monarch expresses his preference for Commander due to its simplicity and ease of use.

52:11 - Live Demonstration: Publishing a Simple npm Package

Monarch guides Anthony through the process of creating and publishing a simple npm package from scratch. They initialize a new package, add a "Hello, World!" script, and publish it to npm.

62:02 - Next Steps and Future Collaboration

Anthony and Monarch discuss the next steps for their respective projects. Anthony plans to explore converting C++ code to Node.js and integrating Ragged's functionality into his CLI tool. They agree to continue collaborating on a weekly basis, combining their efforts where possible.

  / monarchwadia  
  / 1784782610167640360