OpenViSTAI · Agents · Blockchain · Crypto
Menu
Developer Tools

Solc Js

Solc Js is an open-source TypeScript library providing JavaScript bindings to the Solidity compiler. It uses Emscripten-compiled compiler builds from solc-bin and can be used through Node.js, a command-line tool or JavaScript-based applications.

Independent OpenViST project profile, based on linked sources.

Solc Js — OpenViST project profile in Developer Tools.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Solc Js when Solidity compilation needs to run inside JavaScript-based tooling rather than only through the standalone Solidity compiler binary.

Who it is for

  • Ethereum developers working with Solidity contracts
  • JavaScript or TypeScript developers integrating compilation into tools
  • Teams building server-side or browser-based applications that invoke Solidity compilation

Documented uses

  • Compile Solidity source from JavaScript or TypeScript
  • Resolve imported contracts through a supplied import callback or command-line paths
  • Use compiler output in build workflows and developer tools
  • Connect Node.js compilation workflows to documented SMT-solving callbacks
Before you choose

Requirements & limits

The repository is public and identifies an MIT license. The documented Node.js setup uses npm, and a global installation provides the solcjs command.

  • Choose the high-level API for a uniform interface based on compiler standard input and output JSON.
  • Use the lower-level API when access to compiler-version-specific interfaces is required.
  • Plan import resolution explicitly: the API callback is synchronous, while command-line projects must define base and include paths.
  • Check feature requirements before replacing the Solidity compiler binary, because the solc-js command-line interface provides fewer features.
  • Treat the SMT-solver callback as experimental; the documented example works through Node.js rather than in the browser.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Install Solc Js and compile a contract with Node.js

Set up the package and compile Solidity source through its documented high-level API.

Before you start

  • Node.js
  • A project using npm
  • Solidity source code

Steps

  1. Install the package with npm install solc.

  2. Create compiler Standard Input JSON containing the Solidity language, source files and output selection.

  3. Pass the serialized input to solc.compile and parse the JSON result.

  4. Read the documented compiler output, such as contract bytecode.

Expected outcome

A JavaScript or TypeScript project receives the Solidity compiler output as JSON.

Guide limitations

  • The documented API example uses synchronous compilation.
  • Import resolution requires a separately supplied callback when dependencies are not included directly.
  • The SMT callback is experimental and is not part of this basic setup.
Source-based practical guide

Compile imported contracts with the solc-js command line

Compile a Solidity entry contract while describing project and dependency paths.

Before you start

  • A global solc installation
  • An entry Solidity file
  • Project files located inside the base path or an include path

Steps

  1. Install the package globally with npm install -g solc.

  2. Use the solcjs command with --bin, --include-path node_modules/ and --base-path . as documented.

  3. Set the base path to the project source root and include paths to locations containing external code.

  4. Review the generated compilation output.

Expected outcome

The command-line compiler can resolve relative imports within the declared project and dependency paths.

Guide limitations

  • The solc-js command-line interface provides fewer features than the Solidity compiler binary.
  • It is not compatible with the solc interface used by an Ethereum client through eth.compile.solidity().
  • Absolute paths outside the declared locations can affect bytecode reproducibility.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
1 October 2026
Original website title
argotorg/solc-js · Official homepage title · retained in its source language