Skip to content

humanbydefinition/create-textmode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

create-textmode (✿◠‿◠)

A zero-friction scaffolder for textmode.js.

JavaScript Vite textmode.js docs Discord ko-fi Github-sponsors

create-textmode.js is a command-line tool to quickly scaffold new projects using textmode.js with sensible defaults and minimal friction.

Just run the CLI via npm create textmode@latest or your package manager's equivalent command, answer a few prompts, and you're ready to start building!

Note

The CLI is still fresh out of the oven, so please report any issues or feature requests on the GitHub repo!

Requirements

  • Node.js 18+ (per engines)
  • One of: npm, pnpm, yarn, or bun on your PATH

Quick start (interactive)

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

# 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 <name>: choose a template (prompts if omitted)
  • --name <projectName> or first positional arg: directory/package name (default suggestion if omitted)
  • --textmode-version <ver>: pin textmode.js (prompts from fetched stable versions; defaults to latest)
  • --pm <npm|pnpm|yarn|bun>: 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

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
# ...