node.jstypescriptnpm-init

Where to find the code behind npm init command or tsc --init command


I am trying to find the code behind the cli commands like

npm init

tsc --init

I tried looking for it in the node repo and typescript repo but couldnt find it yet. can anyone please help me. I cant find any similar question on stackoverflow as well. Many thanks.


Solution

  • It's in the respective github repos, and not too hard to find really if you just navigate around a little:

    https://github.com/npm/cli/blob/latest/lib/commands/init.js