UNPKG

patha

Version:

File paths library. All you need to work with paths. Tiny drop-in replacement for 'path'. Works in Node, Browser, and Deno.

17 lines (16 loc) 471 B
/** * Adds a prefix to the start of the name of the given path * * @example * * ```js * import { addNamePrefix } from "patha" * * addNamePrefix("path/to/file-name.ext", "new-") // gives "path/to/new-file-name.ext" * ``` * * @param path The given file path * @param prefix The prefix to add to the start of the file name * @returns The path with a prefix added to its file name */ export declare function addNamePrefix(path: string, prefix: string): string;