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

src: preload function for Environment #51539

Merged
merged 2 commits into from
Mar 4, 2024

Commits on Feb 26, 2024

  1. src: preload function for Environment

    This PR adds a |preload| arg to the node::LoadEnvironment to allow
    embedders to set a preload function for the environment, which will run
    after the environment is loaded and before the main script runs.
    
    This is similiar to the --require CLI option, but runs a C++ function,
    and can only be set by embedders.
    
    The preload function can be used by embedders to inject scripts before
    running the main script, for example:
    1. In Electron it is used to initialize the ASAR virtual filesystem,
       inject custom process properties, etc.
    2. In VS Code it can be used to reset the module search paths for
       extensions.
    zcbenz committed Feb 26, 2024
    Configuration menu
    Copy the full SHA
    bc1e621 View commit details
    Browse the repository at this point in the history

Commits on Mar 3, 2024

  1. fixup! update comment

    Co-authored-by: Joyee Cheung <[email protected]>
    zcbenz and joyeecheung authored Mar 3, 2024
    Configuration menu
    Copy the full SHA
    1a7ee83 View commit details
    Browse the repository at this point in the history