Skip to content

Content Config ​

Configuration for managing content sources, plugins, and file handling settings.

Options ​

sources ​

  • Type: Array<ContentSource | Promise<ContentSource>>
  • Default: []

A list of content source options that defines where content is downloaded from. You can configure multiple sources and use different source types simultaneously. Each source can be either a direct ContentSource object or a Promise that resolves to a ContentSource.

For detailed source configuration options, see Sources Reference.

plugins ​

  • Type: Array<ContentPlugin>
  • Default: []

A list of content transformation plugins that process content after download. Plugins can modify, analyze, or enhance content before final output.

See Content Plugin Reference for available plugins and usage.

downloadPath ​

  • Type: string
  • Default: .downloads/

Base directory path where downloaded files are stored. Can be absolute or relative path.

tempPath ​

  • Type: string
  • Default: .tmp/%TIMESTAMP%/

Temporary directory path used during content processing. The %TIMESTAMP% token is replaced with current timestamp.

backupPath ​

  • Type: string
  • Default: .backup/%TIMESTAMP%/

Directory path where existing content is backed up before processing new downloads. Critical for recovery if downloads fail.

keep ​

  • Type: string[]
  • Default: []

Glob patterns for files to preserve when clearing directories.

Example:

  • ["*.json"] - Keep all JSON files
  • ["**/*.csv", "*.git*"] - Keep all CSV files in any subdirectory, and any git related files.

backupAndRestore ​

  • Type: boolean
  • Default: true

When enabled:

  • Creates backup of existing files before download
  • Restores backup if any source download fails
  • Ensures atomic success/failure of multi-source downloads

maxTimeout ​

  • Type: number
  • Default: 30000

Maximum time in milliseconds to wait for network requests before timing out.

encodeCharacters ​

  • Type: string
  • Default: <>:"|?*

Special characters to encode in file paths for both content and media downloads. Ensures valid filenames across systems.

Released under the MIT License.