patha
Version:
File paths library. All you need to work with paths. Tiny drop-in replacement for 'path'. Works in Node, Browser, and Deno.
19 lines (18 loc) • 559 B
TypeScript
/**
* Adds a suffix to the end of the name of the given path
*
* @example
*
* ```js
* import { addNameSuffix } from "patha"
*
* addNameSuffix("path/to/file-name.ext", "-old") // gives "path/to/file-name-old.ext"
*
* addNameSuffix("path/to/file-name.ext", ".test") // gives "path/to/file-name.test.ext"
* ```
*
* @param path The given file path
* @param suffix The suffix to add to the end of the file name
* @returns The path with a suffix added to its file name
*/
export declare function addNameSuffix(path: string, suffix: string): string;