Skip to main content
Home

Built and signed on GitHub Actions

Works with
This package works with Node.js, Deno, BunIt is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score100%
Downloads3/wk
Publisheda month ago (0.9.0)

Node.js Filesystem Storage Module

Node.js Filesystem Storage Module

See @storage/main for the bigger picture.

This package provides an implementation of the storage module interface.

This stores values in individual files under a directory hierarchy via Node fs calls. By default this is under a .store dir under the current working dir. This can be overridden via the environment var STORE_FS_ROOT.

Each level of the key becomes a directory up to the last segment which becomes a JSON file.

eg: ["one", "two", "three"] -> .store/one/two/three.json

Import mapping: "$store": "jsr:@storage/node-fs"

Example

import * as store from "jsr:@storage/node-fs";
import { assertEquals } from "jsr:@std/assert";

await store.setItem(["foo", "hello"], "world");

assertEquals(await store.hasItem(["foo", "hello"]), true);
assertEquals(await store.getItem(["foo", "hello"]), "world");

await store.clearItems(["foo"]);
assertEquals(await store.hasItem(["foo", "hello"]), false);
Built and signed on
GitHub Actions

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@storage/node-fs

Import symbol

import * as node_fs from "@storage/node-fs";
or

Import directly with a jsr specifier

import * as node_fs from "jsr:@storage/node-fs";

Add Package

pnpm i jsr:@storage/node-fs
or (using pnpm 10.8 or older)
pnpm dlx jsr add @storage/node-fs

Import symbol

import * as node_fs from "@storage/node-fs";

Add Package

yarn add jsr:@storage/node-fs
or (using Yarn 4.8 or older)
yarn dlx jsr add @storage/node-fs

Import symbol

import * as node_fs from "@storage/node-fs";

Add Package

vlt install jsr:@storage/node-fs

Import symbol

import * as node_fs from "@storage/node-fs";

Add Package

npx jsr add @storage/node-fs

Import symbol

import * as node_fs from "@storage/node-fs";

Add Package

bunx jsr add @storage/node-fs

Import symbol

import * as node_fs from "@storage/node-fs";