Search code examples
node.jsgithubrepositorypackage.jsongit-remote

Create git repo using node package.json


I am just exploring nodejs at the moment and learning about the package.json file it creates during as a result of the npm init command.

It asks for a git repository and as a result it creates this syntax as part of the file:

  "repository" :
   { "type" : "git", 
     "url" : "https://github.com/username/reponame.git"
   }

I have tried it with an existing repository and there is no problem, but is there any way to use the package.json to create the remote repository?

I assume you would need to use a token, so it can check your account perhaps?


Solution

  • The documentation for the npm init command here doesn't state that possibility, so I doubt that it's directly possible.

    But this sounds like an idea for another handy tool.