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)
interface ValueStorageHandlerOptions

Options passed to the ValueStorageHandler storeValueToFile method.

Properties

optional
strict: boolean

If set to true and the value storage handler is able to detect lossy conditions (e.g., storing to a directory but there aren't enough value storage handlers for all properties), the value storage handler will reject with an error if a loss of data condition is detected.

By default, storage is best-effort and values that aren't covered by handlers are ignored.

optional
propertyNameEncoder: (propertyName: string) => string

A string encoding function to apply when converting the name of a property in the input data to a path element in the URL of the destination file/directory. If not specified, defaults to encodePathElement.

Add Package

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

Import symbol

import { type ValueStorageHandlerOptions } from "@scroogieboy/object-to-directory/interfaces";

---- OR ----

Import directly with a jsr specifier

import { type ValueStorageHandlerOptions } from "jsr:@scroogieboy/object-to-directory/interfaces";

Add Package

npx jsr add @scroogieboy/object-to-directory

Import symbol

import { type ValueStorageHandlerOptions } from "@scroogieboy/object-to-directory/interfaces";

Add Package

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

Import symbol

import { type ValueStorageHandlerOptions } from "@scroogieboy/object-to-directory/interfaces";

Add Package

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

Import symbol

import { type ValueStorageHandlerOptions } from "@scroogieboy/object-to-directory/interfaces";

Add Package

bunx jsr add @scroogieboy/object-to-directory

Import symbol

import { type ValueStorageHandlerOptions } from "@scroogieboy/object-to-directory/interfaces";