I just got into this one situation that usually drives me (just a little bit) insane.
I am required to clone the source of a package, then afterwards I need to step into the directory to install the dependencies too.
I know this could be resolved with an alias command, but … maybe it’s time for a subcommand
That way we could prepare a package for being worked on in a single utility command that may also have other useful options.
Cloning from a source
npm clone <packageName>
would go look into the
repository configuration of
packageName on the NPM registry (default, can be overridden with
--registry as usual) and clones it from there with whatever program can be found that might make sense.
"type": "git" -> use
"type": "svn" -> use whatever can handle that.
npm clone <URL>
would clone from the given URL and then do the same as above.
Unless an option like
--no-install is given,
npm clone could then install the dependencies for that package or run a script!
||Where to run the
||A script to run after cloning|
||No automatic install will be run|
npm clone express -r test
Clones the source of the
expresspackage and runs tests.
npm clone typescript -n
Clones TypeScript from GitHub and then does nothing.
npm clone https://github.com/badges/shields -w gh-badges
Clones the shields repository from GitHub and installs the dependencies of the
gh-badgespackage in the
I am looking forward to feedbac and other ideas by you guys