• Given an absolute filesystem path, it makes it relative to the current working directory. This is useful when logging paths to allow the users to click on the file and let the OS open it in the editor of choice.

    Parameters

    • path: string

      Path to relativize.

    • dir: string = ...

      Current working directory.

    Returns string

    Relativized path.