@stryke/path
Version:
A package containing various utilities that expand the functionality of NodeJs's built-in `path` module
15 lines (14 loc) • 486 B
TypeScript
/**
* Replace the base path from the beginning of the given path.
*
* @example
* ```ts
* replacePath("/home/user/project/src/index.ts", "/home/user/project");
* // returns "src/index.ts"
* ```
*
* @param path - The path string to replace a substring from
* @param base - The base path to remove from the beginning of the {@link path}
* @returns The {@link path} with the {@link base} path removed
*/
export declare function replacePath(path: string, base?: string): string;