v8-compile-cache
v8-compile-cache copied to clipboard
Install / uninstall programmatically?
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.
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.