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

Allow to use the Installer programatically #506

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

Conversation

unsegnor
Copy link

@unsegnor unsegnor commented Oct 20, 2024

Allow using Installer programatically regardless of the NODE_ENV variable value.

I was looking for a way to install chromedriver as a javascript function.
I did this in the beginning of the file:

let previousNodeEnv = process.env.NODE_ENV
process.env.NODE_ENV = 'test' //this is needed to get the ChromedriverInstaller from chromedriver/install
process.env.DETECT_CHROMEDRIVER_VERSION = true
const ChromedriverInstaller = require('chromedriver/install')
process.env.NODE_ENV = previousNodeEnv

It would be nice if I could avoid those env variables and call the method with parameters.
Or at least avoid having to set the NODE_ENV, which is the goal of this PR :)

Allow using Installer programatically regardless of the NODE_ENV variable value
@giggio
Copy link
Owner

giggio commented Oct 21, 2024

The problem is that the installer module is not part of the exposed interface, so this is why it is hidden behind a flag.
If I was to expose it then I would not be able to change this file freely, anymore. For example, I would not be able to rename install to something else.
I'd prefer to reflect on what would be exposed, and if it is worth the effort.

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

Successfully merging this pull request may close these issues.

2 participants