Authoring TypeScript/JavaScript libraries

TLDR: Check out a simple and productive template for authoring libraries with browser testing: https://github.com/endel/library-template.ts

At exactly one year ago, André Staltz wrote about why all JavaScript libraries should be authored in TypeScript. I must admit I wasn’t a TypeScript believer at that time.

A lot has changed since then. TypeScript ecosystem evolved like crazy. Today, If I have the opportunity to choose between writing pure JavaScript or TypeScript, I’d choose TypeScript without a doubt. Excellent tooling and less error-prone.

I love TypeScript because it lets you write whatever style you want. Don’t want to use property and method access level (public, private, protected)? Fine. Don’t want to explicitly type everything? Fine. Using an external node module without type definitions for it? Fine (didn’t used to be). Even if your code doesn’t compile, it’s also fine - your JavaScript output can be generated anyway.

Using this template you can author your own TypeScript/JavaScript libraries with ease: https://github.com/endel/library-template.ts

It has as little configuration as possible for testing on browser and node environments.

I’d encourage you to start developing, and more importantly — authoring your libraries — using TypeScript.

🚀🚀🚀

Software Engineer & Indie Game Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store