diff options
author | 2023-02-25 22:47:11 +0700 | |
---|---|---|
committer | 2023-02-25 09:47:11 -0600 | |
commit | 8e09b1afff0e2e147a59324114a03e5b47213007 (patch) | |
tree | e323b300f35f60c3de86b82f43df96d81af55246 | |
parent | cf7a09c0d31d160976bdf349c389e6992664b487 (diff) | |
download | bun-8e09b1afff0e2e147a59324114a03e5b47213007.tar.gz bun-8e09b1afff0e2e147a59324114a03e5b47213007.tar.zst bun-8e09b1afff0e2e147a59324114a03e5b47213007.zip |
docs: improved language in yaml loader example (#2172)
* docs: improved language in yaml loader example
* docs(api/http): fix typo
* docs(api/spawn): fix typo
* docs(api/transpiler): fix typo
-rw-r--r-- | docs/api/http.md | 2 | ||||
-rw-r--r-- | docs/api/spawn.md | 2 | ||||
-rw-r--r-- | docs/api/transpiler.md | 2 | ||||
-rw-r--r-- | docs/runtime/plugins.md | 6 |
4 files changed, 6 insertions, 6 deletions
diff --git a/docs/api/http.md b/docs/api/http.md index 838c73516..1ef0302cb 100644 --- a/docs/api/http.md +++ b/docs/api/http.md @@ -1,5 +1,5 @@ {% callout %} -**Note** — This page documents the `Bun.serve` API. This API is heavily optimized and represents the recommended way to build HTTP servers in Bun. Existing Node.js projectes may use Bun's [nearly complete](/docs/runtime/nodejs#node_http) implementation of the Node.js [`http`](https://nodejs.org/api/http.html) and [`https`](https://nodejs.org/api/https.html) modules. +**Note** — This page documents the `Bun.serve` API. This API is heavily optimized and represents the recommended way to build HTTP servers in Bun. Existing Node.js projects may use Bun's [nearly complete](/docs/runtime/nodejs#node_http) implementation of the Node.js [`http`](https://nodejs.org/api/http.html) and [`https`](https://nodejs.org/api/https.html) modules. {% /callout %} ## Send a request diff --git a/docs/api/spawn.md b/docs/api/spawn.md index 876a0577d..3b7c055e8 100644 --- a/docs/api/spawn.md +++ b/docs/api/spawn.md @@ -8,7 +8,7 @@ Provide a command as an array of strings. The result of `Bun.spawn()` is a `Bun. Bun.spawn(["echo", "hello"]); ``` -The second argument to `Bun.spawn` is a parameters object that can be used ton configure the subprocess. +The second argument to `Bun.spawn` is a parameters object that can be used to configure the subprocess. ```ts const proc = Bun.spawn(["echo", "hello"], { diff --git a/docs/api/transpiler.md b/docs/api/transpiler.md index 184007212..44196a99c 100644 --- a/docs/api/transpiler.md +++ b/docs/api/transpiler.md @@ -83,7 +83,7 @@ If your code uses a macro, it will potentially spawn a new copy of Bun's JavaScr ## `.scan()` -The `Transpiler` instance can also scan some source code and return a list of its imports and exports, plus additional metadata about each one. [Type-only](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)imports and exports are ignored. +The `Transpiler` instance can also scan some source code and return a list of its imports and exports, plus additional metadata about each one. [Type-only](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export) imports and exports are ignored. {% codetabs %} diff --git a/docs/runtime/plugins.md b/docs/runtime/plugins.md index c19ea9145..de8885507 100644 --- a/docs/runtime/plugins.md +++ b/docs/runtime/plugins.md @@ -79,7 +79,7 @@ plugin({ <!-- Internally, Bun's transpiler automatically turns `plugin()` calls into separate files (at most 1 per file). This lets loaders activate before the rest of your application runs with zero configuration. --> -Plugins are primarily used to extend Bun with loaders for additional file types. Let's look at a simple plugin that exposes envLet's look at a sample plugin that implements a loader for `.yaml` files. +Plugins are primarily used to extend Bun with loaders for additional file types. Let's look at a simple plugin that implements a loader for `.yaml` files. ```ts#yamlPlugin.ts import { plugin } from "bun"; @@ -179,7 +179,7 @@ In this case we're using `"object"`—a special loader (intended for use by plug {% /callout %} -Loading a YAML file is useful, but plugins support more than just data loading. Lets look at a plugin that lets Bun import `*.svelte` files. +Loading a YAML file is useful, but plugins support more than just data loading. Let's look at a plugin that lets Bun import `*.svelte` files. ```ts#sveltePlugin.ts import { plugin } from "bun"; @@ -234,7 +234,7 @@ type PluginBuilder = { onLoad: ( args: { filter: RegExp; namespace?: string }, callback: (args: { path: string }) => { - loader?: "js" | "jsx" | "ts" | "tsx" | "json" | "yaml" | "object"; + loader?: "js" | "jsx" | "ts" | "tsx" | "json" | "toml" | "object"; contents?: string; exports?: Record<string, any>; }, |