3

When running npm init you are asked for the git repository (of your project I assume).

I am wondering why? What is the use case to have the git repository url of the project - where the package.json is already in - also in the package.json?

There must be a reason for it right?

zlZimon
  • 2,334
  • 4
  • 21
  • 51

1 Answers1

4

when you are publishing your package to NPM repository there is a link to the git repository inside the package page.

Ponpon32
  • 2,150
  • 2
  • 15
  • 26
  • so this is the only reason?So isn't it the case that the majority of projects using npm are not published to the NPM repository? – zlZimon Dec 05 '19 at 08:43
  • ```Specify the place where your code lives. This is helpful for people who want to contribute. If the git repo is on GitHub, then the npm docs command will be able to find you.``` - As the docs says - it's not a required field so feel free to keep it empty or set a fake url (never try but it should work). – Ponpon32 Dec 05 '19 at 08:45