lein-npm icon indicating copy to clipboard operation
lein-npm copied to clipboard

Show progress when installing

Open danielcompton opened this issue 9 years ago • 2 comments

When you're installing a large package like Karma, it can take a while for it to install. lein-npm currently just sits there and it's not obvious what's happening. It could be good to show some output here, though I'm not sure whether you could show the npm output or something else.

danielcompton avatar Dec 10 '15 04:12 danielcompton

That's a great idea. I'll look into this.

RyanMcG avatar Dec 17 '15 06:12 RyanMcG

So, after doing a bit of research this might be a bit more difficult than anticipated. This is primarily because npm directly manipulates the TTY to generate its progress bar, or at the very least, if npm is not running in a TTY it does not try to output a progress bar. Since leiningen is the running process, it would have to create a pty to "trick" npm into outputting the progress bar. This is difficult to do from Java because there is not builtin support for pty, we'd have to use a library.

Using unbuffer is an option though, so maybe opting in to it if its is in the user's PATH when the lein npm process is running in a TTY would be acceptable.

RyanMcG avatar Dec 17 '15 08:12 RyanMcG