stackblitz-hello-world

Featured

Boot a WebContainer, mount files, install npm packages, and run a dev server in the browser. Use when learning WebContainers, building browser-based IDEs, or running Node.js without a backend server. Trigger: "stackblitz hello world", "webcontainer example", "run node in browser".

AI & Automation 2,359 stars 334 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# StackBlitz Hello World ## Overview Boot a WebContainer, mount a file system tree, install dependencies with npm, and start a dev server -- all running inside the browser tab. No backend server needed. ## Prerequisites - `@webcontainer/api` installed (see `stackblitz-install-auth`) - Cross-origin isolation headers configured - Modern browser (Chrome 90+, Firefox 90+, Safari 16.4+) ## Instructions ### Step 1: Define File System Tree ```typescript import { WebContainer, FileSystemTree } from '@webcontainer/api'; const files: FileSystemTree = { 'package.json': { file: { contents: JSON.stringify({ name: 'wc-hello', scripts: { start: 'node index.js', dev: 'nodemon index.js' }, dependencies: { express: '^4.18.0' }, }), }, }, 'index.js': { file: { contents: ` const express = require('express'); const app = express(); app.get('/', (req, res) => res.send('Hello from WebContainer!')); app.listen(3000, () => console.log('Server running on port 3000')); `.trim(), }, }, src: { directory: { 'utils.js': { file: { contents: 'module.exports = { greet: (n) => "Hello " + n };' } }, }, }, }; ``` ### Step 2: Boot and Mount ```typescript const wc = await WebContainer.boot(); await wc.mount(files); console.log('Files mounted. Installing dependencies...'); ``` ### Step 3: Install Dependencies ```typescript const installProcess = await wc.spawn('npm', ['install']); // Stream install output install...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
8 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category