file-processor
Classes
- FileProcessor
The
FileProcessor
class provides functionalities to process files within a specified folder. It offers methods to print, parse, write, and filter files based on the provided arguments and configurations.
Typedefs
- PluginOptions
Represents the plugin options provided to the application.
- FolderData
Represents the data of a folder, including its paths, tree structure, and excluded files.
- ParseReturn
Represents the return value after parsing a file.
FileProcessor
The FileProcessor
class provides functionalities to process files within a specified folder. It offers methods to print, parse, write, and filter files based on the provided arguments and configurations.
fileProcessor.processFiles(lsFolder, options) ⇒ Promise.<Array.<ParseReturn>>
Processes the files within the specified folder based on the provided arguments.
Kind: instance method of FileProcessor
Returns: Promise.<Array.<ParseReturn>>
- A promise that resolves to an array of processed files.
Param | Type | Description |
---|---|---|
lsFolder | FolderData | Data representing the folder and its contents. |
options | PluginOptions | plugin options to guide the file processing. |
Example
const processor = new FileProcessor();
const processedFiles = await processor.processFiles(folderData, cliArgs);
const processor = new FileProcessor();
const processedFiles = await processor.processFiles(folderData, cliArgs);
PluginOptions
Represents the plugin options provided to the application.
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
dist | string | Destination path for the generated files. |
exclude | string | Patterns to exclude from processing. |
folder | string | Main folder for processing. |
helpers | Array.<string> | List of helper functions or modules. |
include | string | Patterns to include for processing. |
jsDocConfigPath | string | Path to the JSDoc configuration file. |
partials | Array.<string> | List of partial templates or modules. |
readme | string | Path to the README file. |
rmPattern | Array.<string> | Patterns for files to be removed. |
source | string | Source path for the files to be processed. |
title | string | Title for the generated documentation. |
watch | boolean | Flag to determine if the application should watch for file changes. |
FolderData
Represents the data of a folder, including its paths, tree structure, and excluded files.
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
excluded | Array.<DirectoryFile> | List of excluded files. |
paths | Array.<DirectoryFile> | List of all paths in the folder. |
tree | Array.<FileTree> | Tree structure of the folder. |
ParseReturn
Represents the return value after parsing a file.
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
content | string | Content of the parsed file. |
dest | string | Destination path for the parsed file. |
empty | boolean | Flag to determine if the file is empty. |
[excluded] | boolean | Flag to determine if the file was excluded. |
file | DirectoryFile | Details of the parsed file. |
relativePathDest | string | Relative destination path for the parsed file. |
relativePathSrc | string | Relative source path of the parsed file. |
[success] | boolean | Flag to determine if the parsing was successful. |
[type] | StatisticType | Type of statistic for the parsed file. |