function expand( p = ".", cwd = [ __dirname, ".." ] ) {

    let resolved = expand.cache[ p ];

    if ( ! resolved ) {

        if ( typeof cwd === "string" ) cwd = [ cwd ];

        const right = p
            .replace( "\\", "/" )
            .split( "/" );

        resolved = path.join( ...cwd, ...right );

        expand.cache[ p ] = resolved;

    }

    return resolved;

}
Helps to cleanly get the full filesystem path of `p`.

@param {string} p The path to expand
@param {string|string[]} cwd The current working directory (prepended to `p`)