DEV Community

Cover image for Authoring NPM Packages with Monorepos
Ravgeet Dhillon
Ravgeet Dhillon

Posted on • Originally published at ravgeet.in

Authoring NPM Packages with Monorepos

Suppose that you run a software development agency and you want to enforce a common linting rule set and formatting guidelines for all of your JavaScript projects. You could install ESLint and Prettier in each of your projects. However, your company manages more than a hundred different projects, with custom rules for both ESLint and Prettier. So, if you decide to add or deprecate some rules, you'll have to update the rule sets in all of those projects.

A monorepo can help solve this issue. You can put all of your configuration code in a master repository, publish it as an npm package, and then import the npm package into your projects. Next time you want to change the rules, you only need to alter the monorepo project and the change will be reflected in all of your projects, as they're dependent on the monorepo project.

If you follow the steps in this tutorial, you’ll see how you can publish NPM packages using Lerna and keep your packages’ code in a monorepo.

Read the full blog on Fusebit.

Thanks for reading 💜


I publish a monthly newsletter in which I share personal stories, things that I am working on, what is happening in the world of tech, and some interesting dev-related posts which I come across while surfing the web.

Connect with me through TwitterLinkedInGitHub or send me an Email.

Ravgeet, Full Stack Developer and Technical Content Writer

Top comments (0)