Skip to main content

Built and signed on GitHub Actions

Library to write out the contents of a JavaScript object structure to the file system in a granular directory structure.

This package works with Node.js, Deno, Bun
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score
100%
Published
3 months ago (0.1.4)
function storeObjectToDirectory
storeObjectToDirectory(
destinationUrl: URL,
value: Record<string, unknown>,
handlers: Iterable<ValueStorageHandler>,
options?: Readonly<ValueStorageHandlerOptions>,
): Promise<void>

Convenience wrapper around the handler builder in Handlers and the ValueStorageHandler.storeValue directory storage handler method to write the contents of an object to a directory in one step.

Parameters

destinationUrl: URL

The destination in the file system of the directory to create, as a URL.

value: Record<string, unknown>

The object to store.

handlers: Iterable<ValueStorageHandler>

The value storage handlers to consult when storing the properties in the object.

optional
options: Readonly<ValueStorageHandlerOptions>

Options to control the specifics of the storage.

Return Type

Promise<void>

Add Package

deno add jsr:@scroogieboy/object-to-directory

Import symbol

import { storeObjectToDirectory } from "@scroogieboy/object-to-directory";

---- OR ----

Import directly with a jsr specifier

import { storeObjectToDirectory } from "jsr:@scroogieboy/object-to-directory";

Add Package

npx jsr add @scroogieboy/object-to-directory

Import symbol

import { storeObjectToDirectory } from "@scroogieboy/object-to-directory";

Add Package

yarn dlx jsr add @scroogieboy/object-to-directory

Import symbol

import { storeObjectToDirectory } from "@scroogieboy/object-to-directory";

Add Package

pnpm dlx jsr add @scroogieboy/object-to-directory

Import symbol

import { storeObjectToDirectory } from "@scroogieboy/object-to-directory";

Add Package

bunx jsr add @scroogieboy/object-to-directory

Import symbol

import { storeObjectToDirectory } from "@scroogieboy/object-to-directory";