mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
docs: Fix stale init docs (#22208)
Co-authored-by: Michael H <git@riskymh.dev> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Marko Vejnovic <marko@bun.com>
This commit is contained in:
@@ -2,20 +2,29 @@ Scaffold an empty Bun project with the interactive `bun init` command.
|
||||
|
||||
```bash
|
||||
$ bun init
|
||||
bun init helps you get started with a minimal project and tries to
|
||||
guess sensible defaults. Press ^C anytime to quit.
|
||||
|
||||
package name (quickstart):
|
||||
entry point (index.ts):
|
||||
? Select a project template - Press return to submit.
|
||||
❯ Blank
|
||||
React
|
||||
Library
|
||||
|
||||
Done! A package.json file was saved in the current directory.
|
||||
+ index.ts
|
||||
+ .gitignore
|
||||
+ tsconfig.json (for editor auto-complete)
|
||||
+ README.md
|
||||
✓ Select a project template: Blank
|
||||
|
||||
+ .gitignore
|
||||
+ index.ts
|
||||
+ tsconfig.json (for editor autocomplete)
|
||||
+ README.md
|
||||
|
||||
To get started, run:
|
||||
bun run index.ts
|
||||
|
||||
bun run index.ts
|
||||
|
||||
bun install v$BUN_LATEST_VERSION
|
||||
|
||||
+ @types/bun@$BUN_LATEST_VERSION
|
||||
+ typescript@5.9.2
|
||||
|
||||
7 packages installed
|
||||
```
|
||||
|
||||
Press `enter` to accept the default answer for each prompt, or pass the `-y` flag to auto-accept the defaults.
|
||||
|
||||
@@ -9,20 +9,29 @@ Run `bun init` to scaffold a new project. It's an interactive tool; for this tut
|
||||
|
||||
```bash
|
||||
$ bun init
|
||||
bun init helps you get started with a minimal project and tries to
|
||||
guess sensible defaults. Press ^C anytime to quit.
|
||||
|
||||
package name (quickstart):
|
||||
entry point (index.ts):
|
||||
? Select a project template - Press return to submit.
|
||||
❯ Blank
|
||||
React
|
||||
Library
|
||||
|
||||
Done! A package.json file was saved in the current directory.
|
||||
+ index.ts
|
||||
+ .gitignore
|
||||
+ tsconfig.json (for editor auto-complete)
|
||||
+ README.md
|
||||
✓ Select a project template: Blank
|
||||
|
||||
+ .gitignore
|
||||
+ index.ts
|
||||
+ tsconfig.json (for editor autocomplete)
|
||||
+ README.md
|
||||
|
||||
To get started, run:
|
||||
bun run index.ts
|
||||
|
||||
bun run index.ts
|
||||
|
||||
bun install v$BUN_LATEST_VERSION
|
||||
|
||||
+ @types/bun@$BUN_LATEST_VERSION
|
||||
+ typescript@5.9.2
|
||||
|
||||
7 packages installed
|
||||
```
|
||||
|
||||
Since our entry point is a `*.ts` file, Bun generates a `tsconfig.json` for you. If you're using plain JavaScript, it will generate a [`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) instead.
|
||||
@@ -88,11 +97,15 @@ Bun can also execute `"scripts"` from your `package.json`. Add the following scr
|
||||
"name": "quickstart",
|
||||
"module": "index.ts",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
+ "scripts": {
|
||||
+ "start": "bun run index.ts"
|
||||
+ },
|
||||
"devDependencies": {
|
||||
"@types/bun": "latest"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "^5"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user