Scaffold textmode.js projects with zero friction
npm install create-textmodetextmode.js.
create-textmode.js is a command-line tool to quickly scaffold new projects using textmode.js with sensible defaults and minimal friction.
npm create textmode@latest or your package manager's equivalent command, answer a few prompts, and you're ready to start building!
engines)
bash
npm create textmode@latest
or
pnpm create textmode@latest
or
yarn create textmode
...
`
The CLI will prompt for project name, template, textmode.js version, installing dependencies, and starting the dev server.
Non-interactive examples
`bash
TypeScript template, pin textmode.js, auto-install, do not run dev server
npm create textmode@latest my-textmode-app -- --template vanilla-ts --textmode-version 0.7.1 --install --no-run
JavaScript template with pnpm, skip install and run
pnpm create textmode@latest demo -- --template vanilla-js --pm pnpm --no-install --no-run
`
Options
- --template : choose a template (prompts if omitted)
- --name or first positional arg: directory/package name (default suggestion if omitted)
- --textmode-version : pin textmode.js (prompts from fetched stable versions; defaults to latest)
- --pm : force a package manager (auto-detected otherwise)
- --install / --no-install: install dependencies after scaffold (prompts if neither is provided)
- --run / --no-run: start the dev server after install (prompts if neither is provided)
- --force: allow using a non-empty directory without prompting
- --help: show usage
- --version: show the CLI version
Templates
All templates ship with Vite, textmode.js, Prettier, ESLint, and a .gitignore. TypeScript variants add tsconfig and a typecheck script. Below are the extras that differ by template:
| Template | Flavor | Extras |
|:---------|:-------|:-------|
| vanilla-js | JavaScript | Base starter sketch |
| vanilla-ts | TypeScript | Base starter sketch + TS config |
| vanilla-js-fxhash | JavaScript + fx(hash) | Bundled fxhash.min.js, starter sketch using $fx API and features |
| vanilla-ts-fxhash | TypeScript + fx(hash) | Bundled fxhash.min.js, $fx typings, starter sketch using $fx API and features |
| vanilla-js-tweakpane | JavaScript + Tweakpane | UI controls wired with Tweakpane |
| vanilla-ts-tweakpane | TypeScript + Tweakpane | UI controls wired with Tweakpane + TS config |
Adding new templates? Keep the shared tooling note above and only list what’s unique in the table.
Local development
`bash
npm install
npm test # vitest
npm run test:verbose
Run CLI directly (no npm-create shim); no "--" needed
node bin/index.js demo --template vanilla-js --pm pnpm --no-install --no-run
or
node bin/index.js
...
``