Packaging a Node.js Application

Viewed 22

I'm developing a Strapi base project (A headless cms written with node.js). I want to package my app so I can install it in other projects as a dependency and take the development further from there (i.e. I want to develop an e-commerce web app or something like that in other areas). My need is if there was ever a bug in the base project, after solving the bug, I want to go into the final projects and bump the base project version in package.json and prevent myself from repeating the bug fix on each final individual project (DRY).

Any suggestions?

1 Answers

Welcome to stackoverflow, this question is a bit broad, but it's your first one so I'll let ya have it. Normally you should show what you've tried, examples of code that isn't working etc. ;-)

What you're talking about is a private npm package see this to start and then this for being able to use it via npm install.

It's a fairly common pattern in teams that have shared libraries, an NPM package is simply a set of javascript functions you can install from npm for convenience.

Related