{"library":"solc-0.8.1-fixed","title":"solc-js","type":"library","description":"JavaScript bindings for the Solidity compiler, enabling Solidity smart contract compilation directly in Node.js or the browser via Emscripten. This version 0.8.1 is a fixed release of the official npm package by the Ethereum Foundation. It provides both a high-level API (uniform `compile` method using Standard JSON I/O) and a low-level API exposing compiler internals. Key differentiators: it wraps the native Solidity compiler, supports imports via callbacks, and the command-line interface (`solcjs`) is not compatible with the native `solc` binary. Major breaking changes include the removal of the old callback-based API since v0.6.0. Regular releases track Solidity compiler versions.","language":"javascript","status":"active","last_verified":"Fri May 01","install":{"commands":["npm install solc-0.8.1-fixed"],"cli":{"name":"solcjs","version":null}},"imports":["import { compile } from 'solc';","import * as solc from 'solc';","const solc = require('solc');"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/ethereum/solc-js","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/solc-0.8.1-fixed","openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"const solc = require('solc');\nconst input = {\n  language: 'Solidity',\n  sources: {\n    'test.sol': { content: 'contract C { function f() public { } }' }\n  },\n  settings: { outputSelection: { '*': { '*': ['*'] } } }\n};\nconst output = JSON.parse(solc.compile(JSON.stringify(input)));\nfor (const contractName in output.contracts['test.sol']) {\n  console.log(`${contractName}: ${output.contracts['test.sol'][contractName].evm.bytecode.object}`);\n}","lang":"javascript","description":"Compiles a minimal Solidity contract using the high-level API and prints the bytecode.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}