@pixeljs/create
v0.0.6
Published
Create a ready-to-run PixelJS game project in JavaScript or TypeScript.
Maintainers
Readme
@pixeljs/create
Creates a ready-to-run PixelJS game project: a platformer in JavaScript or strict TypeScript.
Usage
# Asks which starter you want (TypeScript when the terminal is not interactive)
npm create @pixeljs@latest my-game
# Or choose the starter directly
npm create @pixeljs@latest my-game -- --template typescript
npm create @pixeljs@latest my-game -- --template javascript
# Equivalent direct invocation
npx @pixeljs/create my-game --template typescriptThen:
cd my-game
npm install
npm run devnpm create @pixeljs runs this package. Note that npm create pixeljs (without the @) would look for an unrelated unscoped package named create-pixeljs.
Templates
| Template | What you get |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| typescript (default) | A small, winnable platformer in strict TypeScript: a sprite hero, shapes, text, synthesized sounds and music, keyboard and gamepad input, and a production build |
| javascript | The same platformer in JavaScript |
npm run build writes the finished game to dist/, a folder of static files you can publish on any web host.
Options
-t, --template <name>:typescriptorjavascript. Without it, an interactive terminal asks; otherwise the starter istypescript-f, --force: write into a non-empty directory, replacing files with the same names-h, --help: show help and the list of templates-v, --version: show the version
The destination must be empty unless --force is given. The tool never writes through symbolic links, runs no install scripts and makes no network requests; npm install in the new project is your own step. The starters use Vite and depend only on @pixeljs/core at runtime.
License
MIT
