{"library":"solc","title":"solc-js","type":"library","description":"JavaScript bindings for the Solidity compiler (solc), providing a high-level and low-level API to compile Solidity smart contracts to EVM bytecode. The current stable version is 0.8.35, following the Solidity compiler releases closely. It uses Emscripten-compiled Solidity binaries from solc-bin, supporting all compiler features via the Standard JSON interface. Key differentiators: it's the official JavaScript wrapper for Solidity, enabling dynamic compilation in Node.js and browser environments without a native binary. The package ships TypeScript types and supports both CommonJS and ESM modules (ESM requires Node >=12).","language":"javascript","status":"active","last_verified":"Fri May 01","install":{"commands":["npm install solc"],"cli":null},"imports":["import { compile } from 'solc'","import solc from 'solc'","import { compileCallback } from 'solc'","import { version } from 'solc'"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":"https://soliditylang.org","github":"https://github.com/ethereum/solc-js","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/solc","openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import { compile } from 'solc';\n\nconst input = {\n  language: 'Solidity',\n  sources: {\n    'test.sol': {\n      content: 'contract C { function f() public { } }'\n    }\n  },\n  settings: {\n    outputSelection: {\n      '*': {\n        '*': ['evm.bytecode.object']\n      }\n    }\n  }\n};\n\nconst output = JSON.parse(compile(JSON.stringify(input)));\nconsole.log(output.contracts['test.sol'].C.evm.bytecode.object);","lang":"typescript","description":"Compiles a simple Solidity contract using the high-level API with Standard JSON input.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}