# @remix-project/remix-solidity

> Tool to load and run Solidity compiler

Latest version **0.5.77** (published 2026-04-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @remix-project/remix-solidity
pnpm add @remix-project/remix-solidity
yarn add @remix-project/remix-solidity
bun add @remix-project/remix-solidity
```

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; no vulnerabilities; high maintenance score.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.5.77 |
| Published | 2026-04-27 |
| First published | 2020-08-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 14 |
| Unpacked size | 105.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3052 |
| Author | Remix Team |
| Maintainers | ryestew, yann300, aniket-engg, ioedeveloper, yann_remixlabs |

## Links

- npm: https://www.npmjs.com/package/@remix-project/remix-solidity
- Repository: https://github.com/remix-project-org/remix-project
- Homepage: https://github.com/remix-project-org/remix-project/tree/master/libs/remix-solidity#readme
- Issues: https://github.com/remix-project-org/remix-project/issues
- npm.io page: https://npm.io/package/@remix-project/remix-solidity

## Dependencies (14)

- [solc](https://npm.io/package/solc.md) 0.8.26
- [async](https://npm.io/package/async.md) ^2.6.2
- [ethers](https://npm.io/package/ethers.md) ^6.14.0
- [semver](https://npm.io/package/semver.md) ^6.3.0
- [minixhr](https://npm.io/package/minixhr.md) ^3.2.2
- [ethjs-util](https://npm.io/package/ethjs-util.md) ^0.1.6
- [eslint-scope](https://npm.io/package/eslint-scope.md) ^5.0.0
- [@ethereumjs/tx](https://npm.io/package/@ethereumjs/tx.md) ^10.1.1
- [@ethereumjs/vm](https://npm.io/package/@ethereumjs/vm.md) ^10.1.1
- [@ethereumjs/util](https://npm.io/package/@ethereumjs/util.md) ^10.1.1
- [@ethereumjs/block](https://npm.io/package/@ethereumjs/block.md) ^10.1.1
- [string-similarity](https://npm.io/package/string-similarity.md) ^4.0.4
- [webworkify-webpack](https://npm.io/package/webworkify-webpack.md) ^2.1.5
- [@remix-project/remix-lib](https://npm.io/package/@remix-project/remix-lib.md) ^0.5.100

## Recent versions

- 0.5.77 (latest) — 2026-04-27
- 0.5.11-alpha.17 (alpha) — 2023-03-15
- 0.5.8-alpha.2 (beta) — 2023-01-25
- 0.5.76 — 2026-04-15
- 0.5.75 — 2026-04-09
- 0.5.74 — 2026-04-09
- 0.5.73 — 2026-04-09
- 0.5.72 — 2026-03-27
- 0.5.71 — 2026-03-26
- 0.5.70 — 2025-12-24
- 0.5.69 — 2025-12-10
- 0.5.68 — 2025-12-03
- 0.5.67 — 2025-11-18
- 0.5.66 — 2025-10-16
- 0.5.65 — 2025-09-23
- … 108 more at https://npm.io/package/@remix-project/remix-solidity/versions

## README

## Remix-Solidity
[![npm version](https://badge.fury.io/js/%40remix-project%2Fremix-solidity.svg)](https://www.npmjs.com/package/@remix-project/remix-solidity)
[![npm](https://img.shields.io/npm/dt/@remix-project/remix-solidity.svg?label=Total%20Downloads)](https://www.npmjs.com/package/@remix-project/remix-solidity)
[![npm](https://img.shields.io/npm/dw/@remix-project/remix-solidity.svg)](https://www.npmjs.com/package/@remix-project/remix-solidity)
[![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/remix-project-org/remix-project/tree/master/libs/remix-solidity)
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/remix-project-org/remix-project/issues)


`@remix-project/remix-solidity` is a tool to load and run solidity compiler. It works underneath Remix IDE  "Solidity Compiler" plugin which is used to load different versions of compiler and compile the smart contracts. 

### Installation

`@remix-project/remix-solidity` is an NPM package and can be installed using NPM as:

`yarn add @remix-project/remix-solidity`

### How to use

`@remix-project/remix-solidity` exports:
```
    {
        Compiler: Compiler,
        CompilerInput: CompilerInput
    }
```
`CompilerInput` can be used to form the [compiler input](https://github.com/remix-project-org/remix-project/blob/master/libs/remix-solidity/src/compiler/types.ts#L1) by passing the [options](https://github.com/remix-project-org/remix-project/blob/master/libs/remix-solidity/src/compiler/types.ts#L144)

`Compiler` is a class containing various methods to perform compiler related actions. Have a look at `Compiler` interface:

```
class Compiler {
    handleImportCall: (fileurl: string, cb: Function) => void;
    event: EventManager;
    state: CompilerState;
    constructor(handleImportCall: (fileurl: string, cb: Function) => void);
    /**
     * @dev Setter function for CompilerState's properties (used by IDE)
     * @param key key
     * @param value value of key in CompilerState
     */
    set<K extends keyof CompilerState>(key: K, value: CompilerState[K]): void;
    /**
     * @dev Internal function to compile the contract after gathering imports
     * @param files source file
     * @param missingInputs missing import file path list
     */
    internalCompile(files: Source, missingInputs?: string[]): void;
    /**
     * @dev Compile source files (used by IDE)
     * @param files source files
     * @param target target file name (This is passed as it is to IDE)
     */
    compile(files: Source, target: string): void;
    /**
     * @dev Called when compiler is loaded, set current compiler version
     * @param version compiler version
     */
    onCompilerLoaded(version: string): void;
    /**
     * @dev Called when compiler is loaded internally (without worker)
     */
    onInternalCompilerLoaded(): void;
    /**
     * @dev Called when compilation is finished
     * @param data compilation result data
     * @param missingInputs missing imports
     * @param source Source
     */
    onCompilationFinished(data: CompilationResult, missingInputs?: string[], source?: SourceWithTarget): void;
    /**
     * @dev Load compiler using given URL (used by IDE)
     * @param usingWorker if true, load compiler using worker
     * @param url URL to load compiler from
     */
    loadVersion(usingWorker: boolean, url: string): void;
    /**
     * @dev Load compiler using 'script' element (without worker)
     * @param url URL to load compiler from
     */
    loadInternal(url: string): void;
    /**
     * @dev Load compiler using web worker
     * @param url URL to load compiler from
     */
    loadWorker(url: string): void;
    /**
     * @dev Gather imports for compilation
     * @param files file sources
     * @param importHints import file list
     * @param cb callback
     */
    gatherImports(files: Source, importHints?: string[], cb?: gatherImportsCallbackInterface): void;
    /**
     * @dev Truncate version string
     * @param version version
     */
    truncateVersion(version: string): string;
    /**
     * @dev Update ABI according to current compiler version
     * @param data Compilation result
     */
    updateInterface(data: CompilationResult): CompilationResult;
    /**
     * @dev Get contract obj of the given contract name from last compilation result.
     * @param name contract name
     */
    getContract(name: string): Record<string, any> | null;
    /**
     * @dev Call the given callback for all the contracts from last compilation result
     * @param cb callback
     */
    visitContracts(cb: visitContractsCallbackInterface): void | null;
    /**
     * @dev Get the compiled contracts data from last compilation result
     */
    getContracts(): CompilationResult['contracts'] | null;
    /**
     * @dev Get sources from last compilation result
     */
    getSources(): Source | null | undefined;
    /**
     * @dev Get sources of passed file name from last compilation result
     * @param fileName file name
     */
    getSource(fileName: string): Source['filename'] | null;
    /**
     * @dev Get source name at passed index from last compilation result
     * @param index    - index of the source
     */
    getSourceName(index: number): string | null;
}
```

### Contribute

Please feel free to open an issue or a pull request. 

If you'd like to add some code, please take a look at our contribution guidelines [here](https://github.com/remix-project-org/remix-project/blob/master/CONTRIBUTING.md). You can reach us on [Discord](https://discord.gg/MzhfCGstNA) with any questions.   

### License
MIT © 2018-21 Remix Team

---
_Source: https://npm.io/package/@remix-project/remix-solidity · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
