How to add contributors (collaborators) to a npm package?

3.7k Views Asked by At

I created a npm package few months ago, and a friend was nice enough to help me make the original project into a package and upload it to npm. Now I'm an owner of the package but only he is shown under collaborators. As it is my package and I did most of the work I would love to be mentioned as a collaborator.

We tried npm owner add but it didn't help.

Here is the package: https://www.npmjs.com/package/react-singular-component

BTW: I am an owner.

2

There are 2 best solutions below

0
On

The npm collaborators (in the website) is the owner (in the command line).

Note: owners are people with the ability to publish new versions of the package so you may not want to add everyone as an owner for security reasons.

Please run the following command on your terminal:

npm owner add <user> [<@scope>/]<pkg>

Where the parameter is the NPM username of the collaborator to include. It goes without saying: the collaborator must have an NPM account to be included.

See the npm owner docs.

0
On

To be more specific, I think you're looking for some sort of way to display all contributors in your package. There's an npm package called All-Contributors which you can use to generate a nice looking grid of contributors with their github profile photos.

You can install it by running:

yarn add -D all-contributors

Initialize your project with:

yarn all-contributors init

you can add a contributor by running

yarn all-contributor add <github-username> doc

Checkout the docs for more information on how to use the package.