diff options
| -rw-r--r-- | README.md | 117 |
1 files changed, 90 insertions, 27 deletions
@@ -34,47 +34,110 @@ If using Linux, kernel version 5.6 or higher is strongly recommended, but the mi - [Install](#install) - [Using bun.js - a new JavaScript runtime environment](#using-bunjs---a-new-javascript-runtime-environment) + - [Types for bun.js (editor autocomplete)](#types-for-bunjs--editor-autocomplete-) + - [Fast paths for Web APIs](#fast-paths-for-web-apis) - [Using bun as a package manager](#using-bun-as-a-package-manager) - [Using bun as a task runner](#using-bun-as-a-task-runner) - [Using bun with Next.js](#using-bun-with-nextjs) - [Using bun with single page apps](#using-bun-with-single-page-apps) - [Using bun with Create React App](#using-bun-with-create-react-app) - [Using bun with TypeScript](#using-bun-with-typescript) + - [Transpiling TypeScript with Bun](#transpiling-typescript-with-bun) - [Using Tailwind with bun](#using-tailwind-with-bun) - [Not implemented yet](#not-implemented-yet) - - [Limitations & intended usage](#limitations--intended-usage) + - [Limitations & intended usage](#limitations---intended-usage) +- [Benchmarks](#benchmarks) - [Configuration](#configuration) - - [bunfig.toml](#bunfig-toml) + - [bunfig.toml](#bunfigtoml) - [Loaders](#loaders) - [CSS in JS](#css-in-js) + - [When `platform` is `browser`](#when--platform--is--browser-) + - [When `platform` is `bun`](#when--platform--is--bun-) - [CSS Loader](#css-loader) - - [CSS Runtime](#css-runtime) + - [CSS runtime](#css-runtime) - [Frameworks](#frameworks) - [Troubleshooting](#troubleshooting) + - [bun not running on an M1 (or Apple Silicon)](#bun-not-running-on-an-m1--or-apple-silicon-) + - [error: Unexpected](#error--unexpected) + - [bun install is stuck](#bun-install-is-stuck) - [Reference](#reference) - - [`bun install`](#bun-install) - - [`Configuring bun install`](#configuring-bun-install-with-bunfigtoml) - - [`bun run`](#bun-run) - - [`bun create`](#bun-create) - - [`bun bun`](#bun-bun) - - [`bun upgrade`](#bun-upgrade) - - [`bun completions`](#bun-completions) - - [`Bun.serve`](#bunserve---fast-http-server) - - [`Bun.write`](#bunwrite--optimizing-io) - - [`bun:ffi` (Foreign functions interface)](#bunffi-foreign-functions-interface) - - [`bun:sqlite` (SQLite3 driver)](#bunffi-foreign-functions-interface) - - [Node API (napi)](#node-api-napi) - - [`Bun.Transpiler`](#buntranspiler) - - [`transformSync`](#buntranspilertransformsync) - - [`transform`](#buntranspilertransform) - - [`scan`](#buntranspilerscan) - - [`scanImports`](#buntranspilerscanimports) + - [`bun install`](#-bun-install-) + - [Configuring bun install with `bunfig.toml`](#configuring-bun-install-with--bunfigtoml-) + - [Configuring with environment variables](#configuring-with-environment-variables) + - [Platform-specific dependencies?](#platform-specific-dependencies-) + - [Peer dependencies?](#peer-dependencies-) + - [Lockfile](#lockfile) + - [Why is it binary?](#why-is-it-binary-) + - [How do I inspect it?](#how-do-i-inspect-it-) + - [What does the lockfile store?](#what-does-the-lockfile-store-) + - [Why is it fast?](#why-is-it-fast-) + - [Cache](#cache) + - [npm registry metadata](#npm-registry-metadata) + - [`bun run`](#-bun-run-) + - [`bun create`](#-bun-create-) + - [Usage](#usage) + - [Local templates](#local-templates) + - [Flags](#flags) + - [Publishing a new template](#publishing-a-new-template) + - [Testing your new template](#testing-your-new-template) + - [Config](#config) + - [How `bun create` works](#how--bun-create--works) + - [`bun bun`](#-bun-bun-) + - [Why bundle?](#why-bundle-) + - [What is `.bun`?](#what-is--bun--) + - [Position-independent code](#position-independent-code) + - [Where is the code?](#where-is-the-code-) + - [Advanced](#advanced) + - [What is the module ID hash?](#what-is-the-module-id-hash-) + - [`bun upgrade`](#-bun-upgrade-) + - [`bun completions`](#-bun-completions-) +- [`Bun.serve` - fast HTTP server](#-bunserve----fast-http-server) + - [Usage](#usage-1) + - [Error handling](#error-handling) +- [`Bun.write` – optimizing I/O](#-bunwrite----optimizing-i-o) + - [bun:sqlite (SQLite3 module)](#bun-sqlite--sqlite3-module-) + - [bun:sqlite Benchmark](#bun-sqlite-benchmark) + - [Getting started with bun:sqlite](#getting-started-with-bun-sqlite) + - [`Database`](#-database-) + - [Database.prototype.query](#databaseprototypequery) + - [Database.prototype.prepare](#databaseprototypeprepare) + - [Database.prototype.exec & Database.prototype.run](#databaseprototypeexec---databaseprototyperun) + - [Database.prototype.serialize](#databaseprototypeserialize) + - [Database.prototype.loadExtension](#databaseprototypeloadextension) + - [Statement](#statement) + - [Statement.all](#statementall) + - [Statement.values](#statementvalues) + - [Statement.get](#statementget) + - [Statement.run](#statementrun) + - [Statement.finalize](#statementfinalize) + - [Statement.toString()](#statementtostring--) + - [Datatypes](#datatypes) + - [`bun:ffi` (Foreign Functions Interface)](#-bun-ffi---foreign-functions-interface-) + - [Low-overhead FFI](#low-overhead-ffi) + - [Usage](#usage-2) + - [Supported FFI types (`FFIType`)](#supported-ffi-types---ffitype--) + - [Strings (`CString`)](#strings---cstring--) + - [Returning a string](#returning-a-string) + - [Function pointers](#function-pointers) + - [Pointers](#pointers) + - [Passing a pointer](#passing-a-pointer) + - [Reading pointers](#reading-pointers) + - [Not implemented yet](#not-implemented-yet-1) + - [Node-API (napi)](#node-api--napi-) + - [`Bun.Transpiler`](#-buntranspiler-) + - [`Bun.Transpiler.transformSync`](#-buntranspilertransformsync-) + - [`Bun.Transpiler.transform`](#-buntranspilertransform-) + - [`Bun.Transpiler.scan`](#-buntranspilerscan-) + - [`Bun.Transpiler.scanImports`](#-buntranspilerscanimports-) - [Environment variables](#environment-variables) - [Credits](#credits) - [License](#license) - [Developing bun](#developing-bun) - - [VSCode Dev Container](#vscode-dev-container-linux) + - [VSCode Dev Container (Linux)](#vscode-dev-container--linux-) - [MacOS](#macos) + - [Build bun (macOS)](#build-bun--macos-) + - [Verify it worked (macOS)](#verify-it-worked--macos-) + - [Troubleshooting (macOS)](#troubleshooting--macos-) - [vscode-zig](#vscode-zig) ## Using bun.js - a new JavaScript runtime environment @@ -1931,12 +1994,12 @@ brew install sqlite TLDR: -- `Statement.all(...optionalParamsToBind)` returns all rows as an array of objects -- `Statement.values(...optionalParamsToBind)` returns all rows as an array of arrays -- `Statement.get(...optionalParamsToBind)` returns the first row as an object -- `Statement.run(...optionalParamsToBind)` runs the statement and returns nothing -- `Statement.finalize()` closes the statement -- `Statement.toString()` prints the expanded SQL, including bound parameters +- [`Statement.all(...optionalParamsToBind)`](#statementall) returns all rows as an array of objects +- [`Statement.values(...optionalParamsToBind)`](#statementvalues) returns all rows as an array of arrays +- [`Statement.get(...optionalParamsToBind)`](#statementget) returns the first row as an object +- [`Statement.run(...optionalParamsToBind)`](#statementrun) runs the statement and returns nothing +- [`Statement.finalize()`](#statementfinalize) closes the statement +- [`Statement.toString()`](#statementtostring--) prints the expanded SQL, including bound parameters - `get Statement.columnNames` get the returned column names - `get Statement.paramsCount` how many parameters are expected? |
