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
4 months ago (0.1.4)
method DefaultHandlerBuilder.prototype.objectToDirectory
DefaultHandlerBuilder.prototype.objectToDirectory(options: Readonly<ObjectToDirectoryHandlerOptions>): FluentHandler

Create a new directory object storage handler -- this handler writes object contents to directories in the file system, delegating to other handlers for the actual storage of the object's properties.

Directory value storage handlers only respond to canStoreValue when the value is an object.

The handlers are evaluated in order when processing each property in the object to store. If a handler's canStoreValue method returns true for a property, it will be used to store the value. If no handler can store an object-valued property, the directory object storage handler will recursively store that value, too. Remaining non-object values cause an error to be raised or are either ignored, depending on the value of the ValueStorageHandlerOptions.strict option.

Parameters

The options and parameters to control the specifics of the handler.

Return Type

An object implementing the FluentHandler interface that stores objects as directories.

Add Package

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

Import symbol

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

---- OR ----

Import directly with a jsr specifier

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

Add Package

npx jsr add @scroogieboy/object-to-directory

Import symbol

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

Add Package

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

Import symbol

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

Add Package

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

Import symbol

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

Add Package

bunx jsr add @scroogieboy/object-to-directory

Import symbol

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