# @ethereum-waffle/compiler

> Compile solidity without the hassle.

Latest version **4.0.3** (published 2023-01-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ethereum-waffle/compiler
pnpm add @ethereum-waffle/compiler
yarn add @ethereum-waffle/compiler
bun add @ethereum-waffle/compiler
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.3 |
| Published | 2023-01-26 |
| First published | 2020-01-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10.0 |
| Dependencies | 7 |
| Unpacked size | 275.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 959 |
| Author | Marek Kirejczyk |
| Maintainers | ethworks |
| Keywords | ethereum, smart-contracts, solidity, compiler, javascript, typescript, library |

## Links

- npm: https://www.npmjs.com/package/@ethereum-waffle/compiler
- Repository: https://github.com/EthWorks/Waffle
- Issues: https://github.com/EthWorks/Waffle/issues
- npm.io page: https://npm.io/package/@ethereum-waffle/compiler

## Dependencies (7)

- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.7
- [@types/mkdirp](https://npm.io/package/@types/mkdirp.md) ^0.5.2
- [@types/node-fetch](https://npm.io/package/@types/node-fetch.md) ^2.6.1
- [@typechain/ethers-v5](https://npm.io/package/@typechain/ethers-v5.md) ^10.0.0
- [@resolver-engine/imports](https://npm.io/package/@resolver-engine/imports.md) ^0.3.3
- [@resolver-engine/imports-fs](https://npm.io/package/@resolver-engine/imports-fs.md) ^0.3.3

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 4.0.3 (latest) — 2023-01-26
- 4.0.3-dev.238c11c (dev) — 2023-10-12
- 4.0.2 (alpha) — 2022-08-02
- 3.0.0-beta.3 (beta) — 2020-06-12
- 4.0.3-dev.efd5f2a — 2023-10-12
- 4.0.3-dev.0915e72 — 2023-02-15
- 4.0.3-dev.4740ec6 — 2023-02-06
- 4.0.3-dev.a1d89d0 — 2023-01-27
- 4.0.3-dev.f8ca718 — 2023-01-26
- 4.0.3-dev.13d1af0 — 2023-01-26
- 4.0.3-dev.0bc9af4 — 2023-01-26
- 4.0.3-dev.166b72c — 2023-01-26
- 4.0.3-dev.a50814e — 2023-01-24
- 4.0.3-dev.4d27a34 — 2023-01-23
- 4.0.3-dev.e1d3ccd — 2023-01-11
- … 130 more at https://npm.io/package/@ethereum-waffle/compiler/versions

## README

![CI](https://github.com/EthWorks/Waffle/workflows/CI/badge.svg)
[![](https://img.shields.io/npm/v/@ethereum-waffle/compiler.svg)](https://www.npmjs.com/package/@ethereum-waffle/compiler)

![Ethereum Waffle](https://raw.githubusercontent.com/EthWorks/Waffle/master/docs/source/logo.png)

# @ethereum-waffle/compiler

Compile solidity without the hassle.

## Installation

In the current version of waffle (v2.x.x) you will install this package as a dependency of the main waffle package - `ethereum-waffle`.

```
yarn add --dev ethereum-waffle
npm install --save-dev ethereum-waffle
```

If you want to use this package directly please install it via:
```
yarn add --dev @ethereum-waffle/compiler
npm install --save-dev @ethereum-waffle/compiler
```

## Feature overview

**NOTE**: You do not need to use this package directly. You can install it through the main package (`ethereum-waffle`) and use the CLI instead.

### Compilation

This package exposes programmatic api for compiling solidity smart contracts.

You can learn more about it [in the documentation](https://ethereum-waffle.readthedocs.io/en/latest/compilation.html).

Examples:
```ts
// Compilation with a config file
const {compileProject} = require('@ethereum-waffle/compiler');

main();
async function main () {
  await compileProject('path/to/waffle.json');
}
```

```ts
// Compilation with js config
const {compileAndSave, compile} = require('@ethereum-waffle/compiler');

main();
async function main () {
  const config = { sourceDirectory: 'contracts', nodeModulesDirectory: 'node_modules' };

  // compile and save the output
  await compileAndSave(config);

  // just compile
  const output = await compile(config);
  console.log(output);
}
```

### Linking

Example:
```ts
const {link} = require('@ethereum-waffle/compiler');
```

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