npm/npx

[FEATURE] Cache by commit hash when executing from git repo

baruchiro opened this issue · 0 comments

What / Why

The whole idea of npx is to use the saved package, by package version. But if you are using a package by git repo like npx git+https://github.com/eslint/eslint.git, npx will always download the package since the source can be changed without updating the version of the package.

When

  • npx git+https://github.com/eslint/eslint.git multiple times

How

Current Behavior

  • When I installing eslint with npx git+https://github.com/eslint/eslint.git, it always downloading and installing the package:
> npx git+https://github.com/eslint/eslint.git
npx: installed 136 in 155.116s
> npx git+https://github.com/eslint/eslint.git
npx: installed 136 in 136.629s

Expected Behavior

  • Keep the commit hash to know if you already have the expected version.

Who

  • I can do that, I just need guidance.
  • But maybe it under the npm ownership?