Skip to content

Scaffold a minimal HTML/CSS/JS project with Node.js development server

Notifications You must be signed in to change notification settings

laststance/create-web-site

Repository files navigation

create-web-site

Scaffold a minimal HTML/CSS/JS project with Node.js development server.

A CLI tool to instantly generate simple web projects, like a super lightweight version of create-react-app.

Features

  • 🚀 Minimal HTML/CSS/JS setup
  • 📦 Built-in Node.js development server
  • 🔄 Live reload — CSS hot-swap (no flash) + full reload for HTML/JS
  • ⚡ Zero dependencies (Node.js standard library only)
  • 🎯 ESM (import/export) support
  • 🛠️ Start developing immediately

Usage

npx @laststance/create-web-site my-web-site
cd my-web-site
node server.js

Open http://localhost:3000 in your browser to see the generated page.

Generated Project Structure

my-web-site/
├── package.json
├── server.js      # Node.js development server
├── index.html     # Main HTML file
├── style.css      # Stylesheet
└── main.js        # JavaScript entry point

Development Server

The generated project includes a simple static file server:

# Start with default port (3000)
node server.js

# Start with custom port
PORT=8080 node server.js

You can also use the dev script in package.json:

pnpm dev
# or
npm run dev

Live Reload

The development server includes built-in live reload powered by SSE (Server-Sent Events). It activates automatically when the server starts — no configuration needed.

File type Behavior
.css Hot-swap — styles update instantly without page refresh
.html, .js Full reload — page refreshes automatically
.json, .svg Full reload — page refreshes automatically

Changes are debounced (100ms) to handle editor save bursts. The live reload script is injected at runtime and does not modify your template files.

Future Enhancements

Planned features:

  • ✅ Template selection (--template option)
    • HTML Only
    • Tailwind CSS
    • Three.js
  • ✅ CLI options expansion
    • --port <number> - Specify port number
    • --no-install - Skip package.json generation

License

MIT

Author

laststance

About

Scaffold a minimal HTML/CSS/JS project with Node.js development server

Resources

Stars

Watchers

Forks

Packages

No packages published