Skip to main content

compile_or_load

Function compile_or_load 

Source
pub fn compile_or_load(src: &str) -> Result<Program, String>
Expand description

Transparent bytecode cache: return the cached compiled Program for src (skipping lex/parse/lower entirely), else compile it, store it in the ~/.node-js/scripts.rkyv shard, and return it. This runs on EVERY ordinary node foo.js / node -e invocation, so scripts are rkyv-cached automatically — not only under --build. Set NODE_JS_TRACE=1 to log hit/miss to stderr (silent otherwise; normal runs print nothing).