Closed mweststrate closed 4 years ago
Possibly using this: https://github.com/camacho/yarn-or-npm
Possibly using this: camacho/yarn-or-npm
Great lib!
It checks installation of yarn
or npm
on specific computer, but I think it is more correct to check specific project.
If project top directory has yarn.lock
- project uses yarn
and user have to install yarn
on his computer;
If it has package-lock.json
- project uses npm
;
If there is no lock file - npm
?
@rifler yeah, I think that's a better heuristic than what yarn-or-npm had last time I used it (which was over a year ago). I'd raise that issue upstream (perhaps there is such an issue already?).
A new version of the yarn-or-npm
package (v3.0.0) just shipped. It adds support for using a project's client depending on the lockfile, and then falling back to the old behavior of checking if Yarn is installed or not.
Solved in 1.0.2
Currently only
yarn
is supported (or tested at least).npm
would be great to have as well.If someone cares enough about it to make it happen :)