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

Extension of the value storage handler with a fluent API for convenience.

Methods

Give the handler a name.

Add a pattern-based path match pattern.

Add pattern-based path matching: the path in the source must match all of these patterns.

Add pattern-based path matching: the path in the source must match at least one of these patterns.

Add a type matching condition that only matches array values.

Add a type matching condition that only matches object (excluding null and array) values.

whenIsTypeOf(type:
"string"
| "number"
| "bigint"
| "boolean"
| "symbol"
| "undefined"
| "object"
| "function"
): FluentHandler

Add coarse JavaScript type matching using the typeof operator. The handler only can store values whose type matches the argument.

whenIsInstanceOf(classConstructor: new (..._: any[]) => unknown): FluentHandler

Add class instance matching using the instanceof operator. The handler only can store values that are instances of the provided class (constructor).

Add Package

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

Import symbol

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

---- OR ----

Import directly with a jsr specifier

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

Add Package

npx jsr add @scroogieboy/object-to-directory

Import symbol

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

Add Package

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

Import symbol

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

Add Package

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

Import symbol

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

Add Package

bunx jsr add @scroogieboy/object-to-directory

Import symbol

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