# scratch-blocks

> Scratch Blocks is a library for building creative computing interfaces.

Latest version **2.1.19** (published 2026-04-28) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install scratch-blocks
pnpm add scratch-blocks
yarn add scratch-blocks
bun add scratch-blocks
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.1.19 |
| Published | 2026-04-28 |
| First published | 2016-09-24 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 3.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2764 |
| Author | Massachusetts Institute of Technology |
| Maintainers | cwillisf.scratch |

## Links

- npm: https://www.npmjs.com/package/scratch-blocks
- Repository: https://github.com/scratchfoundation/scratch-blocks
- Homepage: https://github.com/scratchfoundation/scratch-blocks#readme
- Issues: https://github.com/scratchfoundation/scratch-blocks/issues
- npm.io page: https://npm.io/package/scratch-blocks

## Dependencies (3)

- [blockly](https://npm.io/package/blockly.md) ^12.4.1
- [@blockly/field-colour](https://npm.io/package/@blockly/field-colour.md) ^6.0.11
- [@blockly/continuous-toolbox](https://npm.io/package/@blockly/continuous-toolbox.md) ^7.0.8

## Recent versions

- 2.1.19 (latest) — 2026-04-28
- 2.0.0-spork.11 (spork) — 2026-03-03
- 2.0.0-beta.2 (beta) — 2024-10-18
- 0.1.0-prerelease.20220318143026 (hotfix) — 2022-03-18
- 2.1.18 — 2026-04-27
- 2.1.17 — 2026-04-21
- 2.1.16 — 2026-04-20
- 2.1.15 — 2026-04-20
- 2.1.14 — 2026-04-17
- 2.1.13 — 2026-04-16
- 2.1.12 — 2026-04-16
- 2.1.11 — 2026-04-14
- 2.1.10 — 2026-04-11
- 2.1.9 — 2026-04-07
- 2.1.8 — 2026-04-02
- … 1472 more at https://npm.io/package/scratch-blocks/versions

## README

# scratch-blocks

Scratch Blocks is a library for building creative computing interfaces.

![An image of Scratch Blocks running on a tablet](https://cloud.githubusercontent.com/assets/747641/15227351/c37c09da-1854-11e6-8dc7-9a298f2b1f01.jpg)

## Version 2.0

The Scratch and Blockly teams are excited to announce the release of Scratch Blocks 2.0! This release is no longer a
fork of Blockly, but rather depends on Blockly as a library. We've also updated from version (mumble mumble) of
Blockly to version 12, which includes many, many bug fixes and improvements.

There will likely be a few bumps in the road as we work toward a user-facing release of this work, but we're excited
to share the code and look forward to your feedback! If you see any problems, please check the
[issues](https://github.com/scratchfoundation/scratch-blocks/issues) and if you don't see it there, please consider
filing an issue with as much detail as possible. Thank you!

## Introduction

Scratch Blocks builds on the [Blockly](https://github.com/RaspberryPiFoundation/blockly) library from Google and the
[Raspberry Pi Foundation](https://www.raspberrypi.org/), to provide a design specification and codebase for building
creative computing interfaces. Together with the
[Scratch Virtual Machine (VM)](https://github.com/scratchfoundation/scratch-vm) this codebase allows for the rapid
design and development of visual programming interfaces. Like
[Blockly](https://github.com/RaspberryPiFoundation/blockly), Scratch Blocks is written in TypeScript and bundled with
webpack. Unlike [Blockly](https://github.com/RaspberryPiFoundation/blockly), Scratch Blocks does not use
[code generators](https://developers.google.com/blockly/guides/configure/web/code-generators), but rather leverages
the [Scratch Virtual Machine](https://github.com/scratchfoundation/scratch-vm) to create highly dynamic, interactive
programming environments.

## Documentation

The "getting started" guide including [FAQ](https://scratch.mit.edu/developers#faq) and [design
documentation](https://github.com/scratchfoundation/scratch-blocks/wiki/Design) can be found in the
[wiki](https://github.com/scratchfoundation/scratch-blocks/wiki).

## Donate

We provide [Scratch](https://scratch.mit.edu) free of charge, and want to keep it that way! Please consider making a
[donation](https://secure.donationpay.org/scratchfoundation/) to support our continued engineering, design, community,
and resource development efforts. Donations of any size are appreciated. Thank you!

## Development

```bash
npm ci
npm run build
```

### Testing

Unit tests run in jsdom and need no additional setup:

```bash
npm run test:unit
```

Browser tests run in Chromium via Playwright. Install the browser once after `npm ci`:

```bash
npx playwright install chromium
npm run test:browser
```

To run all tests:

```bash
npm test
```

To debug a failing browser test with a visible browser window:

```bash
npm run test:browser -- --browser.headless=false
```

or, to also pause on startup and open devtools:

```bash
PWDEBUG=1 npm run test:browser
```

## Committing

This project uses [semantic release](https://github.com/semantic-release/semantic-release) to ensure version bumps
follow semver so that projects depending on it don't break unexpectedly.

In order to automatically determine version updates, semantic release expects commit messages to follow the
[conventional-changelog](https://github.com/bcoe/conventional-changelog-standard/blob/master/convention.md)
specification.

You can use the [commitizen CLI](https://github.com/commitizen/cz-cli) to make commits formatted in this way:

```bash
npm install -g commitizen@latest cz-conventional-changelog@latest
```

Now you're ready to make commits using `git cz`.

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