Options
Menu

@s3-publish/cli Module

Index

Command Options Type aliases

InitLogger

InitOptions

InitOptions: { force?: undefined | false | true; logger?: InitLogger; templatePath: string; writePath?: string | false }

Type declaration

  • Optional force?: undefined | false | true

    Overwrite config file if it exists

  • Optional logger?: InitLogger
  • templatePath: string

    Path to directory containing template files

  • Optional writePath?: string | false

    If false, content will be written to stdout

    default

    .s3p.config.js

LsLogger

LsOptions

LsOptions: { calculateETag?: undefined | false | true; limitRequests?: number | false; logger?: LsLogger; providers: Provider[]; trackIgnored?: undefined | false | true }

Type declaration

  • Optional calculateETag?: undefined | false | true

    If true, calculate ETag (md5 hash) for files (if not already defined)

    default

    false

  • Optional limitRequests?: number | false

    Max parallel file list requests

    default

    1

  • Optional logger?: LsLogger
  • providers: Provider[]

    List files in these providers

  • Optional trackIgnored?: undefined | false | true

    If true, list of ignored files is provided to logger

    default

    false

SyncLogger

SyncOptions

SyncOptions: { limitRequests?: number | false; logger?: SyncLogger; planner: Planner; proceed?: undefined | false | true; trackIgnored?: undefined | false | true; trackSkipped?: undefined | false | true }

Type declaration

  • Optional limitRequests?: number | false

    Max parallel put/copy/delete operations

    default

    1

  • Optional logger?: SyncLogger
  • planner: Planner
  • Optional proceed?: undefined | false | true
    • If true, perform operations without prompting
    • If false, preview operations without performing them or prompting
    • If undefined, prompt to confirm
  • Optional trackIgnored?: undefined | false | true

    If true, list of ignored files is provided to logger

    default

    false

  • Optional trackSkipped?: undefined | false | true

    If true, list of skipped (unchanged/unexpected) files is provided to logger

    default

    false

VersionLogger

VersionLogger: Logger<MessageVersion>

VersionOptions

VersionOptions: { logger?: VersionLogger }

Type declaration

Other Type aliases

ConfigLoader

ConfigLoader: (configPath?: string | null | false) => ConfigFile

Loads configuration file at path

  • If path is falsy, the internal standard config is returned
see

createConfigLoader

Type declaration

    • (configPath?: string | null | false): ConfigFile
    • Parameters

      • Optional configPath: string | null | false

      Returns ConfigFile

CreateCliOptions

CreateCliOptions: { configLoader: ConfigLoader; handleError?: undefined | ((error: Error) => void); parseArgs?: undefined | ((argv: string[]) => Args); templatePath: string }

Type declaration

  • configLoader: ConfigLoader

    Function that returns a parsed config file

    see

    createConfigLoader

  • Optional handleError?: undefined | ((error: Error) => void)

    Handle errors

    remarks

    If undefined and an error occurs, process will exit with code that is greater than 0

  • Optional parseArgs?: undefined | ((argv: string[]) => Args)

    Function that returns a parsed Args object

  • templatePath: string

    Path to s3.config.js template files

ProviderIgnoresOptions

ProviderIgnoresOptions: { ignorePath?: string | false; ignorePatterns?: string[] }

Type declaration

  • Optional ignorePath?: string | false

    Path to .ignore file (glob patterns will be loaded from this file if it exists)

    • If false or empty, no file will be loaded (unless specified with arg)
    default

    .s3p.origin.ignore or .s3p.target.ignore

  • Optional ignorePatterns?: string[]

    Glob patterns to ignore

ProviderOptions

ProviderOptionsWithIgnores

ProviderOptionsWithIgnores: ProviderOptions & ProviderIgnoresOptions

Command Functions

help

  • help(): void

init

ls

sync

version

Other Functions

checkConfig

createCli

createConfigLoader

  • Returns a function that will load a config file when invoked

    remarks

    The req function will be used to the load config file (if it exists). Without this dependency injection, require cannot be used to load the config file if the CLI has been bundled with webpack.

    example

    const configLoader = createConfigLoader(require);

    Parameters

    • req: Require

      Standard NodeJS require function

    Returns ConfigLoader

createIgnores

  • createIgnores(globPatterns?: string[]): FilePredicate | undefined

createLogger

createPlanner

createProvider

loadIgnorePatterns

  • loadIgnorePatterns(ignoreFilePath?: string | false): string[]

Generated using TypeDoc