In the world of front-end development, it is inevitable to use npm packages. Npm packages are an essential part of Nodejs, it is one of its main strengths. But not all of those packages are created equal. Writing NPM packages can be complex with all the build tools and libraries that are at our disposal.
/ introduction-building-a-npm-package-with-t...
The goal of this series is to provide a complete overview of how to create a package. I’ll go through everything that I have learned myself while writing my own npm packages.
Amongst the topic I’ll cover:
How to initialize a repository on GitHub and how to initialize a typescript project
How to configure the build tool to export your library in all the different format node and the web need: formats like umd (universal module definition), commonjs, es modules, iife (immediately invoked function expression).
How to configure Continuous integration with GitHub Actions.
I’ll create a NPM package step by step and you will be able to see the progression. Once we have something working, I will add features. The project will be a simple postcss plugin to modify a CSS file. Then we will create a CLI (Command Line Interface) to modify the CSS. And as we go along, we are going to change the repository into what is called a monorepo.
It is just a quick summary of what we are going to go over, but this should give you an idea if there is anything you might learn from this little course. Note that some of the articles will cover topics that can be applied in other areas than “creating a typescript npm package”.
The first thing we are going to go over in the next article is to initialize the GitHub repository and believe it or not, there are a lot of things to talk about already.