In the previous recipe, we published our sample npm package to Azure Artifacts. In this recipe, we will explore how we can consume the artifact that we published and make use of it. Since we have already enabled upstream sources for our repository, we can also fetch all the dependent packages from our feed.
This recipe is a continuation of the previous Publishing NPM package to Artifacts recipe. I recommend that you read it before continuing if you have not already done so.
To demonstrate the upstream npm package, I installed the colors
package into our original module using the npm install colors --save
command. This created an external dependency in our node module so the Artifacts would cache this external package into our feed.
I also changed the code in our index.js
file so that we can use the colors
module and print the console text in blue:
var colors = require("colors")
exports.printAzureDevOps = function () {
console.log...