npm ci
Instead of rm -rf node_modules
+ npm install
, you can use npm ci
to cleanly install the dependencies in your package-lock.json
. It requires a package-lock.json
to already exist and will automatically delete the node_modules folder if it's present.
See npm ci | npm Docs for more details.
Creating an npm library
- 📺 Create NPM JavaScript Packages using TypeScript • 7 minute video by Basarat Ali concisely demonstrating how to write a tiny
npm
library using TS, publish a compiled version of it tonpm
, and use it in another project. - 📺 Create a React Component Library using TypeScript • 4 minute video by Basarat Ali showing how to write a tiny React
npm
library using TS, publish a compiled version of it tonpm
, and use it in another project. - 📺 Managing CSS when building a React Component Library • 3 minute video by Basarat Ali showing how to add a CSS-in-JS dependency to a React
npm
library.