Appearance
Getting Started
What Hikkaku Is
Hikkaku lets you write Scratch projects in TypeScript.
Important: code inside run() handlers defines Scratch runtime behavior. It is compiled into Scratch blocks, not executed as normal JavaScript at runtime.
Scaffold a New Project
Use create-hikkaku to generate a project from the official template (templates/base).
sh
npx create-hikkaku@latest my-hikkaku-app
# or
bun create hikkaku@latest my-hikkaku-appCommon options:
-y,--yes: skip prompts and use defaults--pm <pm>: force package manager (bun,deno,npm,pnpm,yarn)--agents,--no-agents: include or excludeAGENTS.md--link-claude,--no-link-claude: create or skipCLAUDE.md -> AGENTS.md--skills,--no-skills: run or skip skills setup after scaffolding--ref <git-tag>: use a specific template tag (default:create-hikkaku@<version>)
Example:
sh
npx create-hikkaku@latest my-hikkaku-app -y --pm bun --skills
cd my-hikkaku-app
bun install
bun devManual Setup
Install
sh
bun add hikkakuYour First Project
ts
import { Project } from 'hikkaku'
import { IMAGES } from 'hikkaku/assets'
import { moveSteps, whenFlagClicked } from 'hikkaku/blocks'
const project = new Project()
const cat = project.createSprite('Cat')
cat.addCostume({
...IMAGES.CAT_A,
name: 'cat-a'
})
cat.run(() => {
whenFlagClicked(() => {
moveSteps(10)
})
})
export default projectWith Vite
ts
import hikkaku from 'hikkaku/vite'
import { defineConfig } from 'vite'
export default defineConfig({
plugins: [
hikkaku({
entry: './src/main.ts'
})
]
})Run your app with Vite and open the local dev URL.
Next Steps
- Read Project Basics to understand project structure and safe runtime patterns.
- Read Calculations to avoid invalid JavaScript operators in runtime logic.
- Keep Blocks Overview open while implementing features.
or you can try hikkaku with Playground.