npm for Bitbucket 2.0: Now with private packages!

Reading Time: 2 minutes

(Update: The NPM add-on is now available in the Atlassian Marketplace. See the updated version of this post for more details.)

We’re pleased to announce version 2.0 of Tim’s npm for Bitbucket integration. The major change for this release is the addition of support for private packages. Read on for more information, plus a little easter-egg.

Private repositories

The headline feature for this release is the addition of support for private packages in the official npm repository. If you have private packages, you just need to add your authentication token from your .npmrc in your Bitbucket settings. To do this go to `Bitbucket Settings->Configure NPM Stats`:

Once that is in place you can then visit any Bitbucket npm project with a private package and you will be able to see metadata for it:

One thing to note is that we display slightly different data here, as private packages have different stats stored against them. Private packages now show maintainer and dependency information, instead of downloads. But don’t worry; public packages carry on working the same as before.

As with the previous version, clicking on the metadata will bring you to a custom package.json file viewer that analyses the package data and displays a table of dependencies with current and latest versions:

But to complement this we’ve also added something new…

A small easter-egg

You may notice above in the viewer dropdown there is a third viewer, called Dependency visualisation. When viewing the package.json you can select this option to open up a basic visualization of your package dependencies:

This visualization is also available by clicking on the dependencies count on the main metadata view in your Bitbucket repository.

Getting it now

Version 2.0 of the add-on is currently going through the process of being updated in the Bitbucket marketplace, however if you want to get it early just follow these steps:

  1. Go to Bitbucket Settings -> Manage Integrations and remove the current npm add-on if necessary.
  2. Click on Install add-on from URL.
  3. Enter https://bitbucket-npm.useast.atlassian.io/atlassian-connect.json

That’s all; after that, and setting up your authentication token, your private (or public) packages should now show the updated metadata and data visualization. Have fun!