SBN

Custom Node Module Management using Private npm Registry Configured in Nexus Repository

When we are developing software applications, we design reusable components to apply the power and benefit of reuse. Reuse is still an emerging discipline. It appears in many different forms from ad-hoc reuse to systematic reuse, and from white-box reuse to black-box reuse. It’s similar to dependency/package/library management in programming languages. Example package managers include:
  • Spring Boot/Java : Maven
  • PHP : composer
  • Node.js : npm
  • Python : pip

At my job I had to work with multiple programming languages to build specific micro-services. I designed custom modules based on different languages for common purposes such as logging, alarming, specific database integrations, and message publishing. Those modules have the ability to be integrated with any project based on corresponding programming language. A person can easily use them through a package manager. Module reusability has following advantages:

  • Easy integration
  • Customizable for special purposes
  • Common format can be used throughout the organization
  • Less development effort 
  • An industry best practice
  • More user friendly for developers

We can publish custom modules in above mentioned package managers in private so those who are in a certain organization or group will be able to use them. There are several platforms that can be used to publish and consume those custom modules and here I used Nexus Repository since it has the capability to configure for several tech stacks such as maven, npm, composer, nuget, etc.

Nexus Repository OSS is an open source repository allows you to proxy, collect, and manage your packages/dependencies. I’m going to show you how to configure a private npm registry in Sonatype Nexus Repository, which is free, and how to publish and consume custom Node.js modules in your Node.js projects.

The example shows how to locally host the application and use it. The (Read more...)

*** This is a Security Bloggers Network syndicated blog from Sonatype Blog authored by Nipun Thilakshan. Read the original post at: https://blog.sonatype.com/custom-node-module-management-using-private-npm-registry-configured-in-nexus-repository