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

Install / uninstall programmatically? #35

Open
cspotcode opened this issue Mar 2, 2021 · 1 comment
Open

Install / uninstall programmatically? #35

cspotcode opened this issue Mar 2, 2021 · 1 comment

Comments

@cspotcode
Copy link

Is there a way to use v8-compile-cache as a library?

My use-case is to programmatically install the compile cache, then uninstall it, and for other code in node to be able to require('v8-compile-cache') and for it to install correctly.

Right now, if I temporarily override the env var to prevent installation, I can get access to __TEST__ but it will also prevent subsequent code from calling require('v8-compile-cache') because it is in require() cache already. I'm also not sure __TEST__ can be relied on as a stable API surface.

@cspotcode cspotcode changed the title Use as library? Install / uninstall programmatically? Mar 2, 2021
@cspotcode
Copy link
Author

I created this to expose functionality as a library for programmatic usage. Not thoroughly tested, YMMV.

https://github.com/cspotcode/v8-compile-cache-lib
https://www.npmjs.com/package/v8-compile-cache-lib

The changes are minimal so we could definitely merge them back into here if desired.

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

No branches or pull requests

1 participant