-
-
Notifications
You must be signed in to change notification settings - Fork 405
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
Evaluate usage of npx #528
Comments
I think this is a great idea (and I believe we've had such a discussion before). So it's great to see a library that would make building this functionality easy. Integrating this with yo though would still require the user to first install yo; so we just skip the Does anyone knows more about the private scope? I'm not clear what's the impact of this. |
the gist of the "private scope" is that npx installs things using Note that integrating this with So, putting it all together, if yeoman integrates libnpx and a user has npx available in their system, as most npm users will, you can do:
Or, if they're using the npx fallback:
Which is I think about as short as you can get for any scaffolding ever tbh. ;) Note that this is something users would be able to do just by installing Node.js and nothing else. |
@zkat is there API/integration documentation for npx? |
@SBoudrias the "API" is really just a fairly hacky/quick refactor of what was once a CLI-only app, so I could use it with npm itself. There's nothing specifically documented yet at the JS API level, but also what's currently there is all I need from it, so I'm hoping having other use-cases for it will help develop it a bit. Literally the only consumers of libnpx right now are npm and npx. |
So, what's the progress on this. It would be a very nice to have. Are you still discussing it internally or do you wait for a PR? |
@Telokis PR is welcomed :) |
PR anyone?:) |
libnpx is no longer supported - it's part of npm now. Renaming this issue to note being more generally about using npx. We should note that npx added an installation confirmation prompt for security reasons. It's enabled by default unless a https://docs.npmjs.com/cli/v7/commands/npx#compatibility-with-older-npx-versions |
Kudos to @zkat for suggesting we take a look at npx - a module for executing npm package binaries and installing any dependencies needed for them to work. Here's a demo of npx in action with
yo
:https://twitter.com/maybekatz/status/883846850171641856
libnpx is a lib-ified version of npx that we could embed in
yo
, opening the door to$ yo <generator-name>
installing and running<generator-name>
automatically in a private scope the same way npx does without polluting globals.Why is this potentially useful?
This effectively reduces the two steps of
npm install -g yo generator-name
followed byyo generator-name
intoyo generator-name
- lowering the friction for how easy it would be to start off a new project.The differences between merely stringing these steps into
npm install -g yo generator-name && yo generator-name
and npx support is:npx is slated to land in npm sometime in the next few weeks.
The text was updated successfully, but these errors were encountered: