Strumenti di generazione di frontend
All-in-one JavaScript runtime. Bundler, test runner, e gestore di pacchetti in uno strumento veloce
Avvio 4x più rapido rispetto a Node.js, con un'esecuzione notevolmente più veloce grazie al motore JavaScriptCore
Esegue direttamente i file TypeScript e JSX senza una fase di compilazione, con transpilazione al volo
Installa i pacchetti npm 30x più rapidamente di npm, con cache globale e piena compatibilità
Crea il bundle dei progetti JavaScript/TypeScript in millisecondi, con code splitting, tree shaking e minificazione
Test runner veloce compatibile con l'API di Jest, con mocking, snapshot e copertura del codice
Runtime, bundler, transpiler, package manager e test runner in un unico binario
# Install Bun
curl -fsSL https://bun.sh/install | bash
# Verify installation
bun --version
# Update Bun to latest version
bun upgradeAvvio rapido con un nuovo progetto:# Initialize new project
bun init
# Run TypeScript/JavaScript file
bun run index.ts
# Install dependencies
bun install
# Run with watch mode (hot reload)
bun --watch run index.tsEsecuzione di un progetto Node.js esistente:# Install dependencies (much faster than npm)
bun install
# Run with Bun runtime instead of Node
bun run start
# Or use as drop-in Node replacement
bun run dev
{
"scripts": {
"dev": "bun --watch run src/index.ts",
"build": "bun build src/index.ts --outdir dist",
"test": "bun test",
"start": "bun run dist/index.js"
}
}Bundling con Bun:# Bundle for production
bun build ./src/index.ts --outdir ./dist --target browser
# Bundle with minification
bun build ./src/index.ts --outdir ./dist --minify
# Bundle for Node.js target
bun build ./src/index.ts --outdir ./dist --target nodeTest:# Run all tests
bun test
# Run specific test file
bun test auth.test.ts
# Watch mode
bun test --watch
# With coverage
bun test --coverageVariabili d'ambiente:.envprocess.env o Bun.envIniziate in pochi minuti con il nostro semplice processo di distribuzione VPS
Distribuisci in circa 2 minuti • Accesso totale root • Supporto tramite ticket ed email