Utilities

Utilities for PXE.js.

Installation

Install @pxe/utils.

# NPM npm i @pxe/utils # Yarn yarn add @pxe/utils

Declarations

These are all the @pxe/utils exported utility functions.

Method: utils.staticDir

  • dir?: string: The target directory to serve. Defaults to public.

Serve a directory.

Method: utils.routes

  • dir: string: The target route directory.

Load all exports from the index file of the target directory and all of its child.

Method: utils.routesSync

  • dir: string: The target route directory.

Works the same as utils.routes but the result is not a Promise.