file-path-extractor
v1.0.0
Published
Extracting paths from file comments.
Maintainers
Readme
file-path-extractor
Extracting paths from file comments.
Table of Contents
Install
npm i file-path-extractor
# or
pnpm add file-path-extractor
# or
yarn add file-path-extractorAPI
import type { ExtractOptions, Language } from 'extract-path-from-string';
export interface FileExtractOptions extends ExtractOptions {
language?: Language;
}
/**
* Extract filepath from arbitrary comments.
*/
export declare function extractFromComment(comment: string, options?: FileExtractOptions): string | null;
/**
* Extract the filepath from the comments in the file content.
*/
export declare function extractFromContent(content: string, options?: FileExtractOptions, fileExtension?: string): string[];
/**
* Extract filepath from file comments
*/
export declare function extractFromFile(filePath: string, options?: FileExtractOptions): Promise<string[]>;
/**
* Extract filepath from files in batch
*/
export declare function extractFromFiles(filePaths: string[], options?: FileExtractOptions): Promise<Record<string, string[]>>;