-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Document which CLI flags are/aren't available from node module #3587
Comments
Hi, I noticed that there is no documentation on the format of flags if using lighthouse through nodejs. |
Hey folks, thanks for raising this. You are correct. Output path is a flag that is only respected by the CLI and not when using Lighthouse programmatically under the assumption that if you're using Lighthouse from node you want to consume the results yourself in the object it returns rather than just dump to disk somewhere. I'm converting this issue to better documenting this fact. 👍 |
@patrickhulce, @factordog Has the documentation been updated? Just ran into this while implementing the node module and subsequently discovered this issue. |
No it has not, thanks for flagging this as being prematurely closed @nhodges and double thanks for the PR! :) |
@factordog @mingsterism do you recall why you wanted to set outputpath? did you want html results also? |
@paulirish Been a while since I have had to come back to this situation. But from what I recall yes. It was about passing in the command line flags and getting back similar results as you would there. In fact I dont even think it was just for the HTML but also the JSON (lighthouse --output json --output html). However once it was bought to my attention that the data returned was all the raw data that we could use as we wish I could see why it wasn't technically necessary to be able to pass those types of flags. |
I posted first over at #4715 - but this is more appropriate I believe. We are integrating lighthouse into the quasar-framework as the fourth and final component of our new testing mode, and I have been looking literally way too long (3 hours?) for how to get access to the opts.
It got to the point where I started tracking the way that functions were passing variables within lighthouse core, and then I just caved and decided that before I file an issue I should search for it, because with this many stars I cannot be the first to have this problem. Low and behold, no - this has been an issue for over 6 months... :|
Anyway, I have several recommendations to resolve this.
|
Hello Paul, I'm still struggling to define the outputPath, and yes, I would like to dump the HTML report too. Thanks! |
@taytus output path is one of them that is CLI-only and has been thoroughly documented. |
Thank you @patrickhulce. You are right, I was just starting diving into lighthouse and honestly, I thought it was odd I couldn't easily define the output path for the reports. I posted my hacky workaround here: #5269 (comment) I appreciate your help. |
@taytus if that's all you're doing you should probably just be using the CLI, that's what it's made for, and also why there is an outputPath option there but not in node. |
@patrickhulce, for now, I will follow your advice and go with node. We need to generate different config files for different scenarios, hence the need to set up that inside the .js file. Thank you again. |
Hi there,
Been doing some digging into using lighthouse programmatically.
https://github.com/GoogleChrome/lighthouse/tree/04b685fa9f492039ba54d60bbfaa8345c85c64dd/docs
Looking into passing flags to generate JSON files I noticed that this only actually utilizes this flag in the lighthouse-cli.
So by passing an outputPath would as a result do nothing? This is more of a confirmation more than anything. As I know you get the result set on the response etc and could just create your own file using nodes file system. Im more just wanting to see if I am missing something in utilizing lighthouse to do this for me.
The text was updated successfully, but these errors were encountered: