{"library":"metro-hermes-compiler","title":"Metro Hermes Compiler","description":"An experimental Node.js package providing a high-level API to interface with the Hermes bytecode compiler (HBC). Hermes is an open-source JavaScript engine optimized for React Native apps. This package integrates the compiler as a WebAssembly binary generated via Emscripten, enabling conversion of JavaScript/JSX into Hermes bytecode (.hbc) for improved startup performance on mobile. The current stable version is 0.73.10, with regular releases as part of Metro's release cadence (monthly minor updates). Unlike alternatives like Babel alone, this compiler is purpose-built for Hermes, producing optimized bytecode targeting React Native's Hermes runtime.","language":"javascript","status":"active","last_verified":"Fri May 01","install":{"commands":["npm install metro-hermes-compiler"],"cli":null},"imports":["import { compile } from 'metro-hermes-compiler'","import { compile } from 'metro-hermes-compiler'","import { compileFromSource } from 'metro-hermes-compiler'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { compile } from 'metro-hermes-compiler';\nimport { readFileSync, writeFileSync } from 'fs';\n\nconst source = readFileSync('input.js', 'utf8');\nconst bytecode = compile(source, {\n  sourceURL: 'input.js',\n  sourceMap: true,\n  optimize: true\n});\nwriteFileSync('output.hbc', bytecode);\nconsole.log('Compiled to Hermes bytecode.');","lang":"typescript","description":"Compiles a JavaScript file to Hermes bytecode using the compile function, with source map and optimization enabled.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}