JavaScript bindings for the Solidity compiler, wrapping Emscripten-compiled binaries from solc-bin. The current stable version is 0.8.28 (as of 2025), with a release cadence following Solidity releases (monthly). Key differentiators: it is the official JS wrapper for the Solidity compiler, supports standard JSON I/O (compileStandard/compileStandardWrapper), legacy compile() API, and import callbacks for resolving dependencies. Alternative is solc-typed by TypeChain but this is the canonical package for compiling Solidity in Node.js and browser environments.
npm install krzkaczor-solcNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Compiles a Solidity contract using the standard JSON input/output API (compile wrapper with JSON string).
Use compileStandardWrapper with JSON string input as shown in quickstart.
Switch to compileStandardWrapper.
Always wrap compileStandardWrapper output in try/catch or check for errors before parsing.
Use const solc = require('solc') for CJS, or update to bundler that supports ESM.Use solc.compileStandardWrapper instead.
Check output.errors before accessing contracts.