Skip to main content

joinPaths

Callable

  • joinPaths(...paths: string[]): string

  • Joins paths together.

    For example:

    joinPaths(‘wordpress’, ‘wp-content’) ‘wordpress/wp-content’

    Use this for all PHP paths and do not use path.join(). This is important because Emscripten paths are always POSIX-style paths. Imagine joining paths on Windows:

    path.join(‘wordpress’, ‘wp-content’) ‘\wordpress\wp-content’ // invalid in PHP.wasm

    See the path.join issue for more details:

    https://github.com/WordPress/playground-tools/issues/11#issuecomment-1579074763


    Parameters

    • rest...paths: string[]

      Paths segments to join

    Returns string

    A joined path