Day 16 of 16 — ”Publishing a Package”

applied.math.coding
3 min readSep 10, 2021

This story is part of a series that has been initiated here:

Daily Learning: Advanced TypeScript, Day 0 — ”How to run TypeScript”

If you want to follow all code examples, you should consult this to find some guidance on how to quickly set up a small TypeScript project.

We are at the end of our journey through TypeScript. This last post shall provide the principle ideas on how to create and publish one own TypeScript package.

First of all, important to understand is, when delivering a package, you don’t want to deliver your TypeScript code, you want to deliver the compiled JavaScript assets together with a type declaration. How to do the latter part you actually already saw in the previous post but we will see that things are more simple now.

Creating a package:

Let us regard a simple example which aims finally to publish a TypeScript package to an npm-repository and to make it available to everyone.

  • Create a new folder and name it sample-ts-pckg.

--

--

applied.math.coding

I am a Software Developer - Java, Rust, SQL, TypeScript - with strong interest doing research in pure and applied Mathematics.