Module: markdown-serve/resolver

markdown-serve/resolver

require("markdown-serve/resolver")(urlPath, rootDir, options) → {string}

File resolver utility

Parameters:
Name Type Argument Description
urlPath string

Relative URL path to file to try to resolve. Must start with a / and do not include the file extension

rootDir string

Full path to root folder on file system that contains files to resolve

options resolverOptions <optional>

Optional options to specify default page name and file extension

Properties
Name Type Argument Default Description
defaultPageName string <optional>
index

Name of default document

fileExtension string <optional>
md

File extension of Markdown files

Source:
Returns:

Full path to Markdown file if it exists, otherwise null

Type
string

Markdown file resolver

Source:

Requires

  • module:path
  • module:fs

Methods

require("markdown-serve/resolver")(urlPath, rootDir, options) → {string}

File resolver utility

Parameters:
Name Type Argument Description
urlPath string

Relative URL path to file to try to resolve. Must start with a / and do not include the file extension

rootDir string

Full path to root folder on file system that contains files to resolve

options resolverOptions <optional>

Optional options to specify default page name and file extension

Properties
Name Type Argument Default Description
defaultPageName string <optional>
index

Name of default document

fileExtension string <optional>
md

File extension of Markdown files

Source:
Returns:

Full path to Markdown file if it exists, otherwise null

Type
string