Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/cli/tsc/dts/lib.deno.unstable.d.ts>Deno.openKv

A modern runtime for JavaScript and TypeScript.
Latest
function Deno.openKv
allow-read
allow-write
import { Deno } from "https://deno.land/x/deno@v2.0.4/cli/tsc/dts/lib.deno.unstable.d.ts";
const { openKv } = Deno;

UNSTABLE: New API, yet to be vetted.

Open a new Deno.Kv connection to persist data.

When a path is provided, the database will be persisted to disk at that path. Read and write access to the file is required.

When no path is provided, the database will be opened in a default path for the current script. This location is persistent across script runs and is keyed on the origin storage key (the same key that is used to determine localStorage persistence). More information about the origin storage key can be found in the Deno Manual.

Parameters

optional
path: string

Returns

Promise<Kv>