Skip to content

Commit

Permalink
docs: add driver names
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic committed Dec 19, 2024
1 parent 756fee4 commit 9c53801
Show file tree
Hide file tree
Showing 21 changed files with 67 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/2.drivers/azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Store data in the key-value store of Azure App Configuration.

### Usage

**Driver name:** `azure`

::note{to="https://learn.microsoft.com/en-us/azure/azure-app-configuration/overview"}
Learn more about Azure App Configuration.
::
Expand Down
4 changes: 4 additions & 0 deletions docs/2.drivers/browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ icon: ph:browser-thin

### Usage

**Driver name:** `localstorage` or `sessionstorage`

Store data in [localStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) or [sessionStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage.)

```js
Expand All @@ -34,6 +36,8 @@ Store key-value in IndexedDB.

### Usage

**Driver name:** `indexeddb`

::read-more{to="https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API"}
Learn more about IndexedDB.
::
Expand Down
2 changes: 2 additions & 0 deletions docs/2.drivers/capacitor-preferences.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Learn more about Capacitor Preferences API.

## Usage

**Driver name:** `capacitor-preferences`

To use this driver, you need to install and sync `@capacitor/preferences` inside your capacitor project:

:pm-install{name="@capacitor/preferences"}
Expand Down
8 changes: 8 additions & 0 deletions docs/2.drivers/cloudflare.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ icon: devicon-plain:cloudflareworkers
### Usage

**Driver name:** `cloudflare-kv-binding`

::read-more{to="https://developers.cloudflare.com/workers/runtime-apis/kv"}
Learn more about Cloudflare KV.
::
Expand Down Expand Up @@ -54,6 +56,8 @@ const storage = createStorage({
### Usage

**Driver name:** `cloudflare-kv-http`

::read-more{to="https://developers.cloudflare.com/api/operations/workers-kv-namespace-list-namespaces"}
Learn more about Cloudflare KV API.
::
Expand Down Expand Up @@ -127,6 +131,10 @@ const storage = createStorage({
This is an experimental driver! This driver only works in a cloudflare worker environment and cannot be used in other runtime environments such as Node.js (r2-http driver is coming soon)
::

### Usage

**Driver name:** `cloudflare-r2-binding`

::read-more{to="https://developers.cloudflare.com/r2/api/workers/workers-api-reference/"}
Learn more about Cloudflare R2 buckets.
::
Expand Down
2 changes: 2 additions & 0 deletions docs/2.drivers/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ icon: ph:database
## Usage

**Driver name:** `db0`

This driver stores KV data in any SQL database using [db0](https://db0.unjs.io).

::warning
Expand Down
4 changes: 4 additions & 0 deletions docs/2.drivers/deno.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Learn more about Deno KV.

## Usage (Deno)

**Driver name:** `deno-kv`

::important
`deno-kv` driver requires [Deno deploy](https://docs.deno.com/deploy/kv/manual/on_deploy/) or [Deno runtime](https://docs.deno.com/runtime/) with `--unstable-kv` CLI flag. See [Node.js](#usage-nodejs) section for other runtimes.
::
Expand Down Expand Up @@ -40,6 +42,8 @@ const storage = createStorage({

## Usage (Node.js)

**Driver name:** `deno-kv-node`

Deno provides [`@deno/kv`](https://www.npmjs.com/package/@deno/kv) npm package, A Deno KV client library optimized for Node.js.

- Access [Deno Deploy](https://deno.com/deploy) remote databases (or any
Expand Down
2 changes: 2 additions & 0 deletions docs/2.drivers/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ icon: ph:file-light
## Usage

**Driver name:** `fs` or `fs-lite`

Maps data to the real filesystem using directory structure for nested keys. Supports watching using [chokidar](https://github.com/paulmillr/chokidar).

This driver implements meta for each key including `mtime` (last modified time), `atime` (last access time), and `size` (file size) using `fs.stat`.
Expand Down
2 changes: 2 additions & 0 deletions docs/2.drivers/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ icon: mdi:github
## Usage

**Driver name:** `github`

This driver fetches all possible keys once and keep it in cache for 10 minutes. Due to GitHub rate limit, it is highly recommended to provide a token. It only applies to fetching keys.

```js
Expand Down
2 changes: 2 additions & 0 deletions docs/2.drivers/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ icon: ic:baseline-http
## Usage

**Driver name:** `http`

::note
Supports built-in [http server](/guide/http-server) methods.
::
Expand Down
2 changes: 2 additions & 0 deletions docs/2.drivers/lru-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ icon: material-symbols:cached-rounded
## Usage

**Driver name:** `lru-cache`

Keeps cached data in memory using [LRU Cache](https://www.npmjs.com/package/lru-cache).

See [`lru-cache`](https://www.npmjs.com/package/lru-cache) for supported options.
Expand Down
4 changes: 4 additions & 0 deletions docs/2.drivers/memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ icon: bi:memory
Keeps data in memory using [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map). (default storage)

## Usage

**Driver name:** `memory`

::note
By default, it is mounted at the top level, so it's unlikely that you will need to mount it again.
::
Expand Down
2 changes: 2 additions & 0 deletions docs/2.drivers/mongodb.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ icon: teenyicons:mongodb-outline
## Usage

**Driver name:** `mongodb`

::read-more{to="https://www.mongodb.com/"}
Learn more about MongoDB.
::
Expand Down
2 changes: 2 additions & 0 deletions docs/2.drivers/netlify.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Store data in a [Netlify Blobs](https://docs.netlify.com/blobs/overview/) store.

## Usage

**Driver name:** `netlify-blobs`

```js
import { createStorage } from "unstorage";
import netlifyBlobsDriver from "unstorage/drivers/netlify-blobs";
Expand Down
4 changes: 4 additions & 0 deletions docs/2.drivers/null.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ icon: bi:trash3-fill
This driver does NOT store any data. It will discard any data written to it and will always return null similar to [`/dev/null`](https://en.wikipedia.org/wiki/Null_device)
::

## Usage

**Driver name:** `null`

```js
import { createStorage } from "unstorage";
import nullDriver from "unstorage/drivers/null";
Expand Down
4 changes: 4 additions & 0 deletions docs/2.drivers/overlay.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ All write operations happen on the top level layer while values are read from al

When removing a key, a special value `__OVERLAY_REMOVED__` will be set on the top level layer internally.

## Usage

**Driver name:** `overlay`

In the example below, we create an in-memory overlay on top of fs. No changes will be actually written to the disk when setting new keys.

```js
Expand Down
2 changes: 2 additions & 0 deletions docs/2.drivers/planetscale.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ icon: simple-icons:planetscale
## Usage

**Driver name:** `planetscale`

::read-more{to="https://docs.microsoft.com/en-us/azure/key-vault/secrets/about-secrets"}
Learn more about PlanetScale.
::
Expand Down
2 changes: 2 additions & 0 deletions docs/2.drivers/redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ icon: simple-icons:redis
## Usage

**Driver name:** `redis`

::read-more{to="https://redis.com"}
Learn more about Redis.
::
Expand Down
6 changes: 5 additions & 1 deletion docs/2.drivers/s3.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ S3 driver allows storing KV data to [Amazon S3](https://aws.amazon.com/s3/) or a

Driver implementation is lightweight and based on [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) working with Node.js as well as edge workers.

## Setup
## Usage

**Driver name:** `s3`

### Setup

Setup a "Bucket" in your S3-compatible provider. You need this info:

Expand Down
2 changes: 2 additions & 0 deletions docs/2.drivers/uploadthing.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ There is a known issue that same key, if deleted cannot be used again [tracker i

## Usage

**Driver name:** `uploadthing`

To use, you will need to install `uploadthing` dependency in your project:

:pm-install{name="uploadthing"}
Expand Down
2 changes: 2 additions & 0 deletions docs/2.drivers/upstash.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ icon: simple-icons:upstash
## Usage

**Driver name:** `upstash`

::read-more{to="https://upstash.com/"}
Learn more about Upstash.
::
Expand Down
8 changes: 8 additions & 0 deletions docs/2.drivers/vercel.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ icon: gg:vercel
Learn more about Vercel KV.
::

### Usage

**Driver name:** `vercel-kv`

> [!NOTE]
> Please check [Vercel KV Limits](https://vercel.com/docs/storage/vercel-kv/limits).
Expand Down Expand Up @@ -63,6 +67,10 @@ Learn more about Vercel Blob.
Currently Vercel Blob stores all data with public access.
::

### Usage

**Driver name:** `vercel-blob`

To use, you will need to install [`@vercel/blob`](https://www.npmjs.com/package/@vercel/blob) dependency in your project:

:pm-install{name="@vercel/blob"}
Expand Down

0 comments on commit 9c53801

Please sign in to comment.