# cashc

> Compile Bitcoin Cash contracts to Bitcoin Cash Script or artifacts

Latest version **0.13.3** (published 2026-09-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install cashc
pnpm add cashc
yarn add cashc
bun add cashc
```

Provides the command `cashc`.

## Health

**Score 70/100 (B)** — status: active.

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

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.13.3 |
| Published | 2026-09-15 |
| First published | 2019-06-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 397.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 135 |
| Author | Rosco Kalis |
| Maintainers | rkalis |
| Keywords | bitcoin, bitcoin cash, cashscript, compiler, smart contracts, cashtokens |

## Links

- npm: https://www.npmjs.com/package/cashc
- Repository: https://github.com/CashScript/cashscript
- Homepage: https://cashscript.org
- Issues: https://github.com/CashScript/cashscript/issues
- npm.io page: https://npm.io/package/cashc

## Dependencies (5)

- [antlr4](https://npm.io/package/antlr4.md) ^4.13.2
- [semver](https://npm.io/package/semver.md) ^7.7.2
- [commander](https://npm.io/package/commander.md) ^14.0.0
- [@bitauth/libauth](https://npm.io/package/@bitauth/libauth.md) ^3.1.0-next.8
- [@cashscript/utils](https://npm.io/package/@cashscript/utils.md) ^0.13.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

- 0.13.3 (latest) — 2026-09-15
- 0.14.0-next.5 (next) — 2026-09-15
- 0.14.0-next.4 — 2026-08-20
- 0.14.0-next.3 — 2026-07-30
- 0.14.0-next.2 — 2026-07-23
- 0.14.0-next.1 — 2026-07-07
- 0.14.0-next.0 — 2026-06-26
- 0.13.2 — 2026-06-23
- 0.13.1 — 2026-06-11
- 0.12.2 — 2026-06-11
- 0.13.0 — 2026-05-26
- 0.13.0-next.9 — 2026-05-21
- 0.13.0-next.8 — 2026-05-12
- 0.13.0-next.7 — 2026-04-14
- 0.13.0-next.6 — 2026-03-17
- … 82 more at https://npm.io/package/cashc/versions

## README

# CashScript

[![Build Status](https://github.com/CashScript/cashscript/actions/workflows/github-actions.yml/badge.svg)](https://github.com/CashScript/cashscript/actions/workflows/github-actions.yml)
[![Coverage Status](https://img.shields.io/codecov/c/github/CashScript/cashscript.svg)](https://codecov.io/gh/CashScript/cashscript/)
[![NPM Version](https://img.shields.io/npm/v/cashscript.svg)](https://www.npmjs.com/package/cashscript)
[![NPM Monthly Downloads](https://img.shields.io/npm/dm/cashscript.svg)](https://www.npmjs.com/package/cashscript)
[![NPM License](https://img.shields.io/npm/l/cashscript.svg)](https://www.npmjs.com/package/cashscript)

CashScript is a high-level programming language for smart contracts on Bitcoin Cash. It offers a strong abstraction layer over Bitcoin Cash' native virtual machine, Bitcoin Script. Its syntax is based on Ethereum's smart contract language Solidity, but its functionality is very different since smart contracts on Bitcoin Cash differ greatly from smart contracts on Ethereum. For a detailed comparison of them, refer to the blog post [*Smart Contracts on Ethereum, Bitcoin and Bitcoin Cash*](https://kalis.me/smart-contracts-eth-btc-bch/).

See the [GitHub repository](https://github.com/CashScript/cashscript) and the [CashScript website](https://cashscript.org) for full documentation and usage examples.

## The CashScript Language
CashScript is a high-level language that allows you to write Bitcoin Cash smart contracts in a straightforward and familiar way. Its syntax is inspired by Ethereum's Solidity language, but its functionality is different since the underlying systems have very different fundamentals. See the [language documentation](https://cashscript.org/docs/language/) for a full reference of the language.

## The CashScript Compiler
CashScript features a compiler as a standalone command line tool, called `cashc`. It can be installed through npm and used to compile `.cash` files into `.json` (or `.ts`)artifact files. These artifact files can be imported into the CashScript TypeScript SDK (or other SDKs in the future). The `cashc` NPM package can also be imported inside JavaScript files to compile `.cash` files without using the command line tool.

### Installation
```bash
npm install -g cashc
```

### Usage
```bash
Usage: cashc [options] <source_file>

Arguments:
  source_file                                  The source file to compile.

Options:
  -V, --version                                Output the version number.
  -o, --output <path>                          Specify a file to output the generated artifact.
  -h, --hex                                    Compile the contract to hex format rather than a full artifact.
  -A, --asm                                    Compile the contract to ASM format rather than a full artifact.
  -c, --opcount                                Display the number of opcodes in the compiled bytecode.
  -s, --size                                   Display the size in bytes of the compiled bytecode.
  -S, --skip-enforce-function-parameter-types  Do not enforce function parameter types.
  -L, --skip-enforce-locktime-guard            Do not inject a tx.time guard when tx.locktime is used.
  -f, --format <format>                        Specify the format of the output. (choices: "json", "ts", default: "json")
  -?, --help                                   Display help
```

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