StackpressGitHub

API reference

stackpress/lib

stackpress/lib is the low-level primitive shelf. It exposes Stackpress-compatible data structures, file and queue helpers, event emitters, request and response primitives, parsing helpers, and selected cross-runtime utilities.

Import

import { Nest, Request, Response, Router, Exception } from 'stackpress/lib';

When To Use It

Use this path when you need low-level Stackpress-compatible primitives without importing sibling libraries directly.

Export Inventory

ExportKindPurpose
Nest, ReadonlyNest, path/query/form data primitivesclasses/helpersWork with nested or structured data
FileLoader, NodeFSclassesFile-system and file-loading helpers
ItemQueue, TaskQueueclassesQueue-based processing helpers
EventEmitter, ExpressEmitter, RouteEmitterclassesEvent routing and emission helpers
Request, Response, Router, Terminal, Exception, StatusclassesCore runtime primitives
parsing/object helpersfunctionsConvert input into Stackpress-friendly object structures

Detailed Exports

Nest

  • Kind: class
  • Use it to hold and traverse nested data structures in a Stackpress-compatible way.
import { Nest } from 'stackpress/lib';

const data = new Nest();

Request, Response, Router

  • Kind: classes
  • Use them when you want low-level runtime primitives without going through the higher-level server module.
import { Request, Response, Router } from 'stackpress/lib';

Terminal

  • Kind: class
  • Use it to build or inspect terminal behavior at the primitive layer.
import { Terminal } from 'stackpress/lib';

const terminal = new Terminal();

Exception and Status

  • Kind: classes
  • Use Exception for framework-style runtime errors.
  • Use Status for response/status code helpers.
import { Exception, Status } from 'stackpress/lib';

Parsing Helpers

  • formDataToObject
  • objectFromArgs
  • objectFromJson
  • objectFromQuery
  • objectFromFormData
  • withUnknownHost

Use these when you need to normalize incoming arguments or transport data into the shapes Stackpress expects.

import { objectFromArgs, objectFromQuery } from 'stackpress/lib';