Vishesh Duggar bio photo

Vishesh Duggar

5x founder. Co-founder & CTO Product @vamstar. 15+ years building and advising startups of all sizes. If you're building something cool, I'd love to hear about it.

Looking for advice on product, strategy or engineering?

Book Appointment

Subscribe to my mailing list


Vamstar LinkedIn Twitter Github

I’m not gonna talk about what the different types of dependencies.

If there is a dependency that is a library that you are using to build another library. For example you are building a new ORM that required mongoose As a dependency. Now if the installing app that is using any of the mongoose API directly then they are going to be installing the mongoose library themselves together with your library which will also bring in the mongoose dependency. Most cases this is not an issue but if npm Is not able to resolve the dependency conflict then you might end up with issues arising from conflicting versions of mongoose.

The fixe os to simply in your ORM define mongoose as a peer dependency. But how do you make sure that mongoose actually gets resolved while developing and testing your ORM.

It’s pretty straightforward in your package.json


peerDependencies {
  mongoose: "^5.9.7"
}

devDependencies {
  mongoose: "5.9.7"
}

So add it also as a dev dependency. Tedious yes, could be simpler probably.

15+ Years strategising and delivering growth, engineering, customer value and more. I have served as a CTO to multiple organizations, including Vamstar, AtruHelp, Billaway, SuperSehat, and more.

If you're a founder or CEO eager to move faster and seek tailored strategies for your unique challenges, don't navigate this journey alone. Reach out to me. Together, we can dissect, refine, and optimize your enterprise's trajectory to withstand the tests of time and innovation. Let's make your vision not just a goal, but an impending reality.

I have limited open hours. Book Appointment