However, TypeScript allows you to include type definitions directly in the package the definitions are describing. Combining this with TypeScript’s ability to automatically generate type definitions ensures you’re always using the correct type definitions for your package, while also removing the manual work of maintaining the definitions separately.
Sam Lanning walks you through the process of building and publishing an npm package from scratch using TypeScript. You’ll learn how to export type declarations in a way that allows you to automatically leverage them simply by npm-installing your package.
Sam Lanning is a developer advocate at Semmle, which he joined after deciding to drop out of his master’s at Oxford University after completing his undergraduate computer science degree there. He was the first full-time developer for Semmle’s LGTM platform, and he worked on it for over three years before becoming a developer advocate. He’s been an active member of the security and privacy community for a while, with a particular interest in vulnerability research, cryptography, and peer-to-peer networks, having previously contributed to Signal’s Android and desktop clients among other open source projects. In his free time, he’s been working on an open source project that ties together music and lighting.
Comments on this page are now closed.
For exhibition and sponsorship opportunities, email email@example.com
For information on trade opportunities with O'Reilly conferences, email firstname.lastname@example.org
View a complete list of OSCON contacts
©2019, O'Reilly Media, Inc. • (800) 889-8969 or (707) 827-7019 • Monday-Friday 7:30am-5pm PT • All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners. • email@example.com
All content that I’ll be using for this live coding session can be found on GitHub here: https://github.com/samlanning/typescript-talks/tree/master/writing-npm-libraries-using-typescript
There are instructions, and a Jupyter notebook that can be followed along as I do the presentation.