Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: replace global install with npx #56

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

BearAlliance
Copy link
Contributor

I had no trouble setting up a new project and creating ADRs without installing globally.

@fire
Copy link

fire commented Jan 9, 2022

Confirmed that at least npx log4brains preview worked.

@thomvaill
Copy link
Owner

thomvaill commented Sep 23, 2022

Sorry for the delay. Thank you for your proposal!
However, I am not sure about this one... What are the pros compared to a global install?
Because I have a a cons that bothers me: it is longer to type "npx log4brains " compared to "log4brains "
On the other hand, it enables you to use different versions of Log4brains more easily, I agree.
Also, we have to think about the consequences in the CI pipelines: is it easily possible to cache npx installed packages?

Happy to have feedback on this!

Related ADR: https://thomvaill.github.io/log4brains/adr/adr/20210113-distribute-log4brains-as-a-global-npm-package/

@BearAlliance
Copy link
Contributor Author

What are the pros compared to a global install?

  • One command rather than two (install, then run) for people who do not use it often
  • npx will install the package before executing if it is not already present
  • Can specify the exact version in the command, so it's invocation is more easily scripted and reproducible

the consequences in the CI pipelines: is it easily possible to cache npx installed packages?

If a project includes log4brains in its dependencies or devDependencies, it will be cached along with the other node_modules. npx will prefer the package already installed if there is one.

From the docs

Package names provided without a specifier will be matched with whatever version exists in the local project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants